禁用当前屏幕的旋转?

use*_*449 1 interface-orientation ios

是否可以为当前屏幕启用/禁用旋转参数,或者此属性适用于所有应用程序?

Mat*_*bbi 5

当然:

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    //Choose your available orientation, you can also support more tipe using the symbol |
    //e.g. return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight)
    return (UIInterfaceOrientationMaskPortrait);
}
Run Code Online (Sandbox Code Playgroud)