2012-12-16 59 views
5

我使用:我不知道该怎么办肖像倒挂在iOS 6中

- (NSUInteger)supportedInterfaceOrientations { 

    return UIInterfaceOrientationMaskPortrait; 

} 

我怎么会用这个人像和iOS6的倒挂?

这个工程的景观留下UIInterfaceOrientationMaskLandscapeLeft

这对于景观权UIInterfaceOrientationMaskLandscapeRight

,这两个景观UIInterfaceOrientationMaskLandscape

回答

6

您需要返回方向的有效位掩码你想支持:

纵向和纵向倒置:

- (NSUInteger)supportedInterfaceOrientations { 

    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); 

} 

你可以看到的supported orientation masks

这是一个列表重要的是要注意,您还需要在支持的方向上将肖像倒放:

enter image description here

+0

我已经做了,在项目设置和感谢代码。 – OnkaPlonka

1

您需要使用位或操作符为每个支持的方向。

- (NSUInteger)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskPortrait | 
     UIInterfaceOrientationMaskPortraitUpsideDown; 
} 

为您想要支持的每个方向添加另一个按位或。通常情况下,当你看到一个包含单词“掩码”的常量时,它们就是以这种方式组合的。

1

我有我也是同样的问题here

你也应该解决您的问题。

  • 允许旋转
  • 在顶部组件需要仔细允许再次

关注这些方法,看起来类似,但不

相关问题