iOS强制横屏iOS6后

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO]; 

-(NSUInteger)supportedInterfaceOrientations

{
  return UIInterfaceOrientationMaskLandscapeRight;
}

------- 隐藏StatusBar------

- (UIStatusBarStyle)preferredStatusBarStyle
{
  return UIStatusBarStyleDefault;
  //UIStatusBarStyleDefault = 0 黑色文字,浅色背景时使用
  //UIStatusBarStyleLightContent = 1 白色文字,深色背景时使用
}

- (BOOL)prefersStatusBarHidden
{
  NSLog(@"fdsfa");
  return YES; // 返回NO表示要显示,返回YES将hiden
}

原文地址:https://www.cnblogs.com/tomblogblog/p/4533594.html