On iOS8, displaying my app in landscape mode will hide the status bar but on iOS 7 the status bar is displayed on both orientations

后端 未结 10 1512
暗喜
暗喜 2020-12-02 11:04

I want the status bar to be displayed in both orientations in iOS 8; it\'s being displayed properly in iOS 7.

navigationController.isNavigationBarHidden

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 11:24

    To display status bar in landscape mode in ios 8, try following method

    - (BOOL)prefersStatusBarHidden {
        return NO;
    }
    

    Swift version

    override func prefersStatusBarHidden() -> Bool {
        return false
    }
    

    Swift 3, Xcode 8, iOS 10, /* ViewController.swift */

    override var prefersStatusBarHidden: Bool {
            return false
        }
    

提交回复
热议问题