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);
}
您可以看到
还需要注意的是,您还需要在支持的方向上颠倒列出肖像:
我也有同样的问题
你也应该解决你的问题
- 允许旋转
- 顶部组件需要再次允许
仔细观察那些方法,看起来很相似,但不是我已经在项目设置中完成了,谢谢你的代码。