Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 我不知道';I don’我不知道如何在iOS 6中制作人像和倒置_Iphone_Objective C_Xcode_Ios6_Uiinterfaceorientation - Fatal编程技术网

Iphone 我不知道';I don’我不知道如何在iOS 6中制作人像和倒置

Iphone 我不知道';I don’我不知道如何在iOS 6中制作人像和倒置,iphone,objective-c,xcode,ios6,uiinterfaceorientation,Iphone,Objective C,Xcode,Ios6,Uiinterfaceorientation,我正在使用: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskPortrait; } 在iOS6中,我如何将其用于纵向和倒置 这适用于横向左侧UIInterfaceOrientationMaskLaft和横向左侧 这适用于景观权UIInterfaceOrientationMaskLandscapeRight 对于这两种景观UIInterfaceOrientationMa

我正在使用:

- (NSUInteger)supportedInterfaceOrientations {

    return UIInterfaceOrientationMaskPortrait; 

}
在iOS6中,我如何将其用于纵向和倒置

这适用于横向左侧
UIInterfaceOrientationMaskLaft和横向左侧

这适用于景观权
UIInterfaceOrientationMaskLandscapeRight


对于这两种景观
UIInterfaceOrientationMaskLandscape

您需要对每个支持的方向使用按位OR运算符

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

为要支持的每个方向添加另一个按位或。通常,当您看到一个常量中有单词“mask”时,它们将以这种方式组合。

您需要返回一个有效的位掩码,其中包含您希望支持的方向:

对于纵向和纵向倒置:

- (NSUInteger)supportedInterfaceOrientations {

    return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);

}
您可以看到

还需要注意的是,您还需要在支持的方向上颠倒列出肖像:


我也有同样的问题

你也应该解决你的问题

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

仔细观察那些方法,看起来很相似,但不是

我已经在项目设置中完成了,谢谢你的代码。