iPad横屏调用相册,出现闪退
来源:互联网 发布:mfc串口编程实例 编辑:程序博客网 时间:2024/05/01 11:13
Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
解决办法:
在supported Interface Orientations选中landscapeLeft和LandscapeRight(不选中的话在iOS5.0下第一次运行会竖屏)
在appdelegate添加
#if __IPAD_OS_VERSION_MAX_ALLOWED >= __IPAD_6_0
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return UIInterfaceOrientationMaskLandscape;
}
#endif
在该viewController和上一层的viewController中添加
#pragma mark - Orientation
#pragma mark ios6以下
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
#pragma mark ios6是否支持转屏
-(BOOL)shouldAutorotate
{
return YES;
}
#pragma mark 支持的方向
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
#pragma mark 默认支持的朝向
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
第二种方法:
写一个类继承UIImagePickerController 在里面添加支持横屏的方法,也可以解决。
- iPad横屏调用相册,出现闪退
- 调用安卓手机相册和拍照,出现闪退,原因是创建的包名有问题。
- 解决在 iPad 的横屏情况下调用相册崩溃的问题
- 关于android 5.0调用系统相册闪退
- 关于android 5.0调用系统相册闪退
- iOS10调用相册导致模拟器和xcode闪退
- android 调用小米相册,相机闪退 销毁当前activity
- ios8 下iPad调用相册的方法!
- ios10 相册相机闪退
- IPAD下使用相册横屏异常的解决
- 【iOS开发】iPad横屏打开系统相册崩溃,解决方案
- Android7.0及以上相机相册调用闪退处理封装,向下兼容
- android 调用系统图库剪切图片出现黑屏闪退
- ios6.0,程序为横屏,出现闪退
- IOS6横屏调用UIUIImagePickerController闪退的解决方案
- SOAMANAGER出现闪退
- ios ipad里面调用系统相册图片不完整解决方法
- iOS10相册相机闪退bug
- JNI和NDK的区别
- How to Use MMC/SDC——翻译(其中有很多不理解或翻译不准确的地方,望批评指正)——附件
- android源码下载方式
- Android重力感应示例
- input子系统(二)
- iPad横屏调用相册,出现闪退
- Android自动化测试工具——Monkey
- 2013-BIT程序设计 14.古罗马的加法
- hdu 4490 Mad Veterinarian(bfs)
- mysql 合并列 函数 GROUP_CONCAT
- Android如何防止apk程序被反编译
- UVa Ray, Pass me the dishes! (线段树)
- 向其他进程注入代码的三种方法
- 嵌入式第一张ppt整理