2016-09-29 100 views

回答

1

在項目設置中啓用橫向。

子類的UIViewController並在新的子類(例如MyViewController)添加這些回調:

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { 
    return UIInterfaceOrientationPortrait; 
} 

- (UIInterfaceOrientationMask)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskPortrait; 
} 

制式MyViewController的所有視圖控制器。

在要強制景觀覆蓋與方法的觀點:

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { 
    return UIInterfaceOrientationLandscapeRight; 
} 

- (UIInterfaceOrientationMask)supportedInterfaceOrientations { 
    return UIInterfaceOrientationMaskLandscape; 
} 
相關問題