3

我正在使用UIAlertView但在 IOS 8.3 中我更改为UIAlertViewController因为UIAlertview无法正常工作但UIAlertViewController出现错误导致崩溃

'UIApplicationInvalidInterfaceOrientation',
reason: 'Supported orientations has no common orientation with 
         the application, and 
         [ChartsTableViewController2_iPhone shouldAutorotate] is returning YES'

不知道该怎么办请帮帮我。

4

1 回答 1

3

尝试继承 UIAlertController 并添加此代码。希望能帮助到你。

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL) shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}
于 2015-04-18T10:58:01.657 回答