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