我想知道如何在我的 iOS 5.1.1 应用中禁用纵向和颠倒方向。
我希望我的应用程序仅使用 LandScape 方向(界面是在 .xib 文件中的 Interface Build 中绘制的)并且在旋转的情况下不要更改它。
我特别需要它用于 iOS 5.1.1
最佳答案
类似的问题:how do you make an app ONLY support landscape?
上面的回答中使用了这个方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
return YES;
return NO;
}
关于ios - 旋转后如何禁用 iOS 5.1.1 中方向的更改?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21682279/