yr434

1.9.0以下不需要设置工程支持横竖屏,9.0以上必须要设置支持LandscapeRight

2.maintabBar 里设置

- (BOOL)shouldAutorotate

{

     return NO;

}

3.视频控制器里设置

- (BOOL)shouldAutorotate

{

    return YES;

}

 

- (UIInterfaceOrientationMask)supportedInterfaceOrientations

{

    return UIInterfaceOrientationMaskLandscapeRight;

}

4.在方法里

旋转 window 但是也需要 application设置方向,两者要相反


 

   UIApplication *application=[UIApplication sharedApplication];

    [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];

    application.keyWindow.transform=CGAffineTransformMakeRotation(M_PI*2);

     [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];

 

然后旋转view就可以保证键盘也横屏啦

分类:

技术点:

相关文章:

  • 2021-11-20
  • 2021-07-30
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-06-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-02
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-16
相关资源
相似解决方案