setStatusBarOrientation 方法过期了,有什么替换方法吗?

如题
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight]; 旋转状态栏的方法在ios 9.0 过期了。

http://blog.csdn.net/ginhoor/article/details/20454229 在这边找到了旋转的答案,但是还是想知道ios9的状态栏旋转方法。。。。

阅读 13.4k
2 个回答

表示没有见过需要单独旋转状态栏的需求,如果是横竖屏的话只需要在需要横屏的控制器中添加这个方法就可以了

  • (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
    {
    return UIInterfaceOrientationLandscapeLeft;//向左横屏
    }

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题