正如标题描述的那样,我的应用程序atm的定位存在很大的问题。在不同的幻灯片中,我似乎根本无法控制方向。在我的应用程序中,我尝试了以下工作/不起作用:
我已经尝试删除我的应用程序中的所有UINavigationBars/Tabbar,实际上只使用一个ViewController作为初始ViewController,并且问题仍然存在,只能从信息plist文件中管理方向。简单地说,这个应用程序可以听其他的东西,然后是信息文件,调整方向设置?
我已经尽我最大的努力去理解这个问题,但是我不能说到目前为止我已经获得了更大的“啊哈时刻”,因为苹果提供的所有调整设置的方法在我的应用程序中根本不起作用--至少,伟大的苹果!我们有没有其他人曾经经历过这个问题,或者以前听说过这个问题?
发布于 2012-10-31 19:34:02
- (BOOL)shouldAutorotateToInterfaceOrientation:在iOS 6中被废弃。
您应该重写您的- (NSUInteger)supportedInterfaceOrientations子类的UIViewController方法。
示例:
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;
}编辑:
如果您使用的是UINavigationController,您也必须将其子类化,并实现上面的逻辑。这是预期的功能。相关StackOverflow Q/A:
iOS 6 bug: supportedInterfaceOrientations not called when nav controller used as window root
iOS 6 rotations: supportedInterfaceOrientations doesn´t work?
Set different supportedInterfaceOrientations for different UIViewControllers
https://stackoverflow.com/questions/13165601
复制相似问题