![](/img/trans.png)
[英]iOS sample “GLPaint” can't support orientations portrait, portrait upside-down
[英]I don't know how to do Portrait and Upside down in iOS 6
我在用:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
如何在iOS6中將它用於縱向和顛倒?
這適用於橫向左UIInterfaceOrientationMaskLandscapeLeft
這適用於Landscape right UIInterfaceOrientationMaskLandscapeRight
這對於兩個風景UIInterfaceOrientationMaskLandscape
您需要返回您希望支持的方向的有效位掩碼:
對於肖像和肖像顛倒:
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
您可以看到支持的方向掩碼列表
還需要注意的是,您還需要在支持的方向上顛倒縱向:
您需要對每個支持的方向使用按位OR運算符。
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskPortraitUpsideDown;
}
為要支持的每個方向添加另一個按位OR。 通常,當您看到一個帶有“mask”一詞的常量時,它們就意味着以這種方式組合。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.