强制横屏的App,iPhone项目在调用拍照或相册功能时会崩掉 iphone横屏拍照崩溃 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 - (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;} 能不能给我一个demo啊,谢谢大神 邮箱地址 [email protected] 感激 拍照的时候不会奔溃吧。但是相册的部分的确会。本人的做法是调用相册的时候不用系统的UIImagePickerController。完美解决。 xcode4.5画图填充色的问题 调用地图路径规划服务提示000002 调用服务发生异常 更换了icon,可发布后发现没有变,反复很多次都不行 iOS json数组解析 C++ 文件读取 getline的使用 NSUTF8StringEncoding 转码有时成功,有时失败 ios5 sqlite怎样设置串行模式? Iphone 开发高手进! 新手请教一个语法问题 xcode5的问题 求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。
完美解决。