您当前的位置: 首页 >  ui

培根芝士

暂无认证

  • 6浏览

    0关注

    446博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

IOS6横屏调用UIUIImagePickerController闪退的解决方案

培根芝士 发布时间:2014-11-14 11:23:42 ,浏览量:6

IOS6横屏时调用UIImagePickerController时会出现闪退:

*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'  解决办法,在调用 UIImagePickerController的类中加入下面代码:

@interface UIImagePickerController (LandScapeImagePicker)

@end

@implementation UIImagePickerController (LandScapeImagePicker)

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    if ([self isKindOfClass:[UIImagePickerController class]]) {
        return UIInterfaceOrientationPortrait;
    }
    return [self.topViewController preferredInterfaceOrientationForPresentation];
}
@end

关注
打赏
1660824269
查看更多评论
立即登录/注册

微信扫码登录

0.0892s