iOS 6中的UIPopoverController方向崩溃 [英] UIPopoverController orientation crash in iOS 6
问题描述
我当前的程序仅支持横向显示。
My current program only support landscape orientation.
在iOS 6中,它在 UIPopoverController
上崩溃。
In iOS 6, it crash on UIPopoverController
.
'UIApplicationInvalidInterfaceOrientation',原因:'支持的
方向与应用程序没有共同的方向,
shouldAutorotate返回YES '
'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
我启用项目的所有方向,它运作良好。但是,我需要为所有视图更改很多才能支持格局。
I enable all orientation for project , it's working well. However, I need to change a lot for all of the views to only support landscape.
还有其他简单的修复方法, UIOrientation
in UIPopoverController
?
Is there other easy way to fix , UIOrientation
in UIPopoverController
?
推荐答案
Use these delegates for orientation,
- (BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
这篇关于iOS 6中的UIPopoverController方向崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!