解决alertView在强制横屏时的崩溃问题

问题描述:

Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason'Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES'

解决办法:

添加类别重写shouldAutorotate方法;

#import <UIKit/UIKit.h>


@interface UIAlertView (RotationControl)

- (BOOL)shouldAutorotate;  

@end


#import "UIAlertView+RotationControl.h"


@implementation UIAlertView (RotationControl)


- (BOOL)shouldAutorotate

{

    return NO;

}


@end


解决问题!惊讶

猜你喜欢

转载自blog.csdn.net/xxxboxxx/article/details/70801479