简体   繁体   English

我不知道如何在iOS 6中进行纵向和颠倒

[英]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”一词的常量时,它们就意味着以这种方式组合。

I had me too the same problem here 这里也有同样的问题

Your should solve your problem too. 你也应该解决你的问题。

  • allow the rotations 允许轮换
  • at top components need to allow again 顶部组件需要再次允许

Watch carefully those methods, seems similar, but aren't 仔细观察那些方法,看似相似,但不是

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS示例“GLPaint”不能支持纵向人像,肖像颠倒 - iOS sample “GLPaint” can't support orientations portrait, portrait upside-down 视图控制器不会自动旋转到纵向 - View controller doesn't autorotate to portrait upside down 如何应对iOS倒置拍照 - How to deal with iOS taking upside down picture 无法将界面方向旋转为纵向倒置 - Cannot rotate interface orientation to portrait upside down 我不了解并且不知道如何解决的ImagePicker IOS错误 - ImagePicker IOS errors i don't understand and don't know how to fix 当在纵向模式下观看时,iOS在应用进入背景时显示的图像显示为颠倒 - The image that iOS shows when app goes into background appears upside down when seen in portrait mode 如何在iOS 8中的模态视图控制器中强制纵向方向? - How do I force portrait orientation in a modal view controller in iOS 8? iPhone的人像高度-“常规”,上下颠倒-“紧凑”-为什么? - iPhone's Portrait height - 'Regular', Upside Down one - 'Compact' - why? ios7 UINavigationBar backgroundImage被设置为颠倒 - ios7 UINavigationBar backgroundImage is set upside down iOS 8颠倒方向,启用XCode选项,仍然无法正常工作 - iOS 8 upside down orientation, XCode option enabled, still doesn't work
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM