解决方案 »
- Button上面添加一个手势UIGestureRecognizer
- UITableView怎么判断已经dragging到最顶端??
- 想问一下,腾讯开放平台申请的应用里面的key不是即时生效的吗?
- 【iPad】关于在storyboard中segue使用popover传递数据的一个问题,请教一下大家。
- objective-C 两个viewcontroller之间如何调用方法
- XCODE5还能用mrc吗
- 关于搜索调用API接口,有个bug
- 问一个关于下载文件的问题
- 通过UITextView的文本长度控制rightBarButtonItem是否可用
- 各位大神,谁知道iOS8之后,不越狱的情况下要怎么获取imei,
- 求Xcode4.1或者4.6版本
- 关于自定delegate的问题
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [window.rootViewController supportedInterfaceOrientations];
}
最主要的是ViewController里的方向方法,需要横屏的VC的所有父VC都要类似于这样写:// 针对对NavController的一个Demo
- (BOOL)shouldAutorotate {
return [[self.viewControllers lastObject] shouldAutorotate];
}- (NSUInteger)supportedInterfaceOrientations {
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}然后在你需要横屏的VC里:- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight;
}
但是相册的部分的确会。
本人的做法是调用相册的时候不用系统的UIImagePickerController。
完美解决。