目前我只有在iPhone应用程序中的肖像模式。我想在应用程序中允许一个控制器的横向模式,但不幸的是我无法使其工作。iPhone应用程序风景模式不起作用
我在plist文件有以下设置:
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
而且我实现我的控制器来使用这些方法:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
-(BOOL)shouldAutorotate
{
return YES;
}
我使用导航控制器的应用程序,所以我意识到,这可能是问题。我分类UINavigationController
并再次以上述相同的方式实施shouldAutorotateToInterfaceOrientation
,supportedInterfaceOrientations
和shouldAutorotate
。当然,我使用subclassed导航控制器来显示控制器应该有旋转能力。我也尝试按类别覆盖导航控制器的方法,但它也不起作用。
我从一开始就不在应用程序上工作,我继承了代码。如果有可能如何限制全球景观这可能是我的情况。为了测试我使用iPhone 6.0模拟器,但我的部署目标是5.0。我感谢任何提示/帮助。
http:// stackoverflow。com/questions/12600082/set-orientation-to-landscape-mode-in-xcode-4-5-gm-ios-6 – Rushabh