2013-12-09 41 views
1

在我的.plist文件中啓用界面方向支持。但我只需要在一個viewController中啓用橫向方向。在其他viewController我不能禁用風景模式。請告訴我如何禁用除一個viewController外的所有viewController的橫向模式。如何禁用ios 7中的界面方向更改

回答

1

您可以使用

- (BOOL) shouldAutorotate 
{ 
    return YES; 
} 

-(NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskPortrait; 
    //return here which orientation you are going to support 

} 
我有此相同問題
+0

。無論我如何設置支持的界面方向,它始終允許旋轉。並且supportedInterfaceOrientations甚至會被調用! shouldAutorotate永遠不會被調用。 – Justin