首页 > 移动平台 > 详细

Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES

时间:2019-07-31 11:01:09      阅读:441      评论:0      收藏:0      [点我收藏+]

某一个页面横屏时会出现崩溃的问题描述,原因是当你在AppDelegate中返回的设备方向是UIInterfaceOrientationMaskLandscapeLeft.但是你在视图控制器中返回支持自动旋转。就会抛出此异常。

解决方法 重写UIAlertContrller 的shouldAutorotate 方法,

#import <UIKit/UIKit.h>
 
@interface UIAlertController (Rotation)
- (BOOL)shouldAutorotate;
@end


#import "UIAlertController+Rotation.h"
 
@implementation UIAlertController (Rotation)
- (BOOL)shouldAutorotate
{
    return NO;
}
@end

即可

 

by:初光夫

Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES

原文:https://www.cnblogs.com/widgetbox/p/11274117.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!