【发布时间】:2017-10-10 06:21:51
【问题描述】:
启动屏幕之后的视图需要以设备的方向呈现,但一旦呈现就不应自动旋转到其他方向。我使用了这段代码:
- (BOOL)shouldAutorotate {
[super shouldAutorotate];
return YES;
}
-(UIInterfaceOrientationMask) supportedInterfaceOrientations {
[super supportedInterfaceOrientations];
return UIInterfaceOrientationMaskAll;
}
这适用于 iPad,但在 iPhone 中,将 shouldAutorotate 设置为 NO 只会导致纵向。这是正常行为吗?如果是这样,如何在 iPhone 中支持所有方向而无需自动旋转,仅适用于特定的视图控制器?
【问题讨论】:
标签: ios objective-c iphone uiviewcontroller uiinterfaceorientation