首页 > 代码库 > 关于iPad横屏设置

关于iPad横屏设置

1.项目需要:iPad支持横屏,iPhone支持竖屏,

 (1)技术分享

(2)在info。plist里面设置View controller-based status bar appearance为NO。技术分享

 (3)这样iPad运行为横屏显示,在不需要显示状态栏的情况下,在ViewController设置

    self.navigationController.navigationBar.hidden = YES;

 (4)iphone的RootVIewCOntroller中设置:

-(UIStatusBarStyle)preferredStatusBarStyle{

 

    return UIStatusBarStyleLightContent;

}

-(BOOL) shouldAutorotate{

 

    return NO;

}

-(UIInterfaceOrientationMask)supportedInterfaceOrientations{

 

    return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskPortrait;

    

}

OVER

关于iPad横屏设置