2012-12-16 53 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

你也應該解決您的問題。

  • 允許旋轉
  • 在頂部組件需要仔細允許再次

關注這些方法,看起來類似,但不

相關問題