Status Bar showing black text, only on iPhone 6 iOS 8 simulator

前端 未结 14 988
伪装坚强ぢ
伪装坚强ぢ 2020-12-07 20:16

I\'m trying to convert my iOS 7 app to iOS 8 in Xcode 6 GM, and when i run it on the iPhone 5s or lower simulators with iOS 8 everything is fine, but on the iPhone 6 and 6 P

14条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-07 21:02

    My app's status bar was working fine in iOS 7 using only the project/target settings:

    Status bar style = UIStatusBarStyleLightContent
    

    and

    View controller-based status bar appearance = NO
    

    but in iOS 8 (iPhone 6 and iPhone 6 Plus simulators) the status bar was not showing up. Changing View controller-based status bar appearance to YES and then adding:

        // Objective C
        - (UIStatusBarStyle) preferredStatusBarStyle {
             return UIStatusBarStyleLightContent;
        }
        //Swift
        override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return UIStatusBarStyle.LightContent
        }
    

    to the ViewController resulted in seeing the white status bar again, but only after the initial root controller launches. During the initial launch the status bar remains black.

提交回复
热议问题