作者:mobiledu2502885323 | 来源:互联网 | 2023-05-18 10:58
TheiOSapplicationIamworkingonhasaviewthatneedstobelockedinlandscapeorientation.Up
The iOS application I am working on has a view that needs to be locked in landscape orientation. Up to this point, that was accomplished by using the shouldAutorotate
and supportedInterfaceOrientations
methods, but on an iPad Air 2
running iOS9 beta5
, these methods never fire and the orientation is not locked.
我正在开发的iOS应用程序有一个视图需要锁定为横向。到目前为止,这是通过使用shouldAutorotate和supportedinterfaceorientation方法来实现的,但是在运行iOS9 beta5的iPad Air 2上,这些方法都不会触发,而且方向也没有锁定。
I have tried on the following devices, methods fired on all except the Air2 (running debug with Xcode beta6): iPhone 6+, iPad Mini, iPad Air 2, iPad 2, iPad 3
我已经尝试了以下的设备,除了Air2(用Xcode beta6运行调试):iPhone 6+, iPad Mini, iPad Air2, iPad 2, iPad 3。
The methods not firing are as follows:
不点火的方法如下:
- (BOOL)shouldAutorotate {
return YES;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationMaskLandscapeRight;
}
View controller is displayed via presentViewController
视图控制器通过presentViewController显示
3 个解决方案