只支持横屏

pragma mark ----只支持横屏

-(BOOL)shouldAutorotate{
return NO;
}

-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}

  • (UIInterfaceOrientationMask)supportedInterfaceOrientations
    {
    return UIInterfaceOrientationMaskLandscape;
    }

p 方法二

  • (UIInterfaceOrientationMask)supportedInterfaceOrientations
    {
    return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
    }

你可能感兴趣的:(只支持横屏)