[英]I don't know how to do Portrait and Upside down in iOS 6
I am using: 我在用:
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
How would I use this for Portrait and Upside down in iOS6? 如何在iOS6中将它用于纵向和颠倒?
this works for landscape left UIInterfaceOrientationMaskLandscapeLeft
这适用于横向左
UIInterfaceOrientationMaskLandscapeLeft
and this for Landscape right UIInterfaceOrientationMaskLandscapeRight
这适用于Landscape right
UIInterfaceOrientationMaskLandscapeRight
and this for both landscapes UIInterfaceOrientationMaskLandscape
这对于两个风景
UIInterfaceOrientationMaskLandscape
You need to return a valid bitmask of the orientations you wish to support: 您需要返回您希望支持的方向的有效位掩码:
For portrait and portrait upside down: 对于肖像和肖像颠倒:
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
}
You can see a list of the supported orientation masks 您可以看到支持的方向掩码列表
It's important to note also, that you need to list portrait upside down in your supported orientations as well: 还需要注意的是,您还需要在支持的方向上颠倒纵向:
You need to use the bitwise OR operator for each supported orientation. 您需要对每个支持的方向使用按位OR运算符。
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait |
UIInterfaceOrientationMaskPortraitUpsideDown;
}
Add another bitwise OR for each orientation you want to support. 为要支持的每个方向添加另一个按位OR。 Typically, when you see a constant with the word "mask" in it, they are meant to be combined in this way.
通常,当您看到一个带有“mask”一词的常量时,它们就意味着以这种方式组合。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.