`
wjjxf
  • 浏览: 237538 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Supported orientations has no common orientation with the application, and shoul

    博客分类:
  • ios
阅读更多

在调用UIImagePickerController出现这个错误的解决办法:
Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
在Info.plist里需要设置程序支持Portrait,同时编写一个继承类继承UIImagePickerController。

@interface NonRotatingUIImagePickerController : UIImagePickerController
@end

@implementation NonRotatingUIImagePickerController
- (BOOL) shouldAutorotate
{
    return YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
    return UIInterfaceOrientationMaskAllButUpsideDown;
    //return UIInterfaceOrientationMaskLandscape;
#endif
}
@end

 
原因是UIImagePickerController默认是竖屏,所以程序需要支持竖屏,然后通过自定义的controller来支持具体的屏幕类型。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics