作为标题,我想知道现在是否有可能在iOS 9中通过编程来锁定方向?这对我的应用程序很重要,但我找不到方法来实现它。谢谢。
使用 supportedInterfaceOrientations 和 preferredInterfaceOrientationForPresentation 管理方向,例如:
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIInterfaceOrientationPortrait;
}