试过了下面两个方法都无效,请问该怎么办?

ipad 应用 锁定lanscape状态不变,无论怎么旋转,如何实现

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

{ 

return UIInterfaceOrientationIsLandscape(interfaceOrientation);

}

还有

(BOOL)shouldAutorotateToInterfaceOrientation:UIInterfaceOrientation)interfaceOrientation 
{ 
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

我用的是ios6


阿晨1998
浏览 125回答 1
1回答

PIPIONE

如果整个程序都要横屏,plist中修改下最省事。 <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationLandscapeLeft</string> </array>或者代码中viewcontroller加,-&nbsp;(BOOL)shouldAutorotate {&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;NO; } -&nbsp;(NSUInteger)supportedInterfaceOrientations {&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;UIInterfaceOrientationMaskLandscapeRight; } -&nbsp;(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;UIInterfaceOrientationLandscapeRight; } -&nbsp;(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;(interfaceOrientation&nbsp;==&nbsp;UIInterfaceOrientationLandscapeRight); }
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

iOS