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