reason: 'Supported orientations has no common orientation with the application, and [PUUIAlbumListViewController shouldAutorotate] is returning YES'
因为系通相册是默认支持竖屏,如果要横屏时打开系统相册,你要在AppDelegate.m中添加如下方法
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)//iPhone
return UIInterfaceOrientationMaskAll;
else//iPad
return UIInterfaceOrientationMaskAllButUpsideDown;
}
然后为UIImagePickerController添加拓展
- (BOOL)shouldAutorotate{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
本文介绍了一种解决方案,针对APP设置强制横屏后打开系统相册导致应用崩溃的问题。通过在AppDelegate中调整支持的方向,并为UIImagePickerController添加自定义方法,实现了APP横屏模式下正常调用系统相册的功能。
2万+

被折叠的 条评论
为什么被折叠?



