[英]Unable to rotate Interface Orientation issue in iOS 6
我有一个应用程序,我想以纵向模式显示。 但我只想在两种模式下显示一个视图。
我已经为iOS5做了这个。 但在iOS6中,我无法做到这一点。
我也尝试了很多代码来解决它。
我怎么解决这个问题?
苹果改变了ios 6的方向。
简而言之,使用以下步骤:
1)在目标 - >摘要中设置支持的方向...
2)在iOS6.0
shouldAutorotateToInterfaceOrientation
,不应该使用shouldAutorotate
方法。因此,我们必须使用shouldAutorotate方法代替此方法。
- (BOOL)shouldAutorotate
{
return NO;
}
3)在方法
supportedInterfaceOrientations
,如果我们想要所有方向,我们必须设置我们想要的方向,如UIInterfaceOrientationMaskAll
- (NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown );
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.