我想创建一个只能在横向视图模式下运行的iOS应用。
我用Google搜索了该方法,最后得到了supportedInterfaceOrientations方法
这是我的尝试:
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft;
}
我试图将上面的代码放在viewController.m和AppDelegate.m上,但是似乎没有用
谢谢,任何意见将不胜感激
您无需编写任何代码即可运行仅支持横向模式的应用程序。只需选择应用目标,然后取消选中纵向和纵向倒置方向并确保选中横向方向即可。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句