2014-02-10 34 views
0

我想知道如何在iOS 5.1.1的应用程序中禁用纵向和上倾方向。 我希望我的应用程序仅使用LandScape方向(界面在Interface Build中以.xib文件形式绘制),并且在旋转的情况下不要更改它。
我特别需要iOS 5.1.1如何禁用旋转后iOS 5.1.1中的方向改变?

回答

1

类似的问题:how do you make an app ONLY support landscape?

在应答使用上述这种方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight) 
     return YES; 

    return NO; 
} 
0

您可以在项目设置中进行设置。在xCode 5中,您可以打开项目导航器,单击您的项目,单击常规选项卡,然后选中您想要的框。