uistatusbar

How to change Status Bar text color in iOS

冷暖自知 提交于 2019-11-25 23:57:39
问题 My application has a dark background, but in iOS 7 the status bar became transparent. So I can\'t see anything there, only the green battery indicator in the corner. How can I change the status bar text color to white like it is on the home screen? 回答1: Set the UIViewControllerBasedStatusBarAppearance to YES in the .plist file. In the viewDidLoad do a [self setNeedsStatusBarAppearanceUpdate]; Add the following method: - (UIStatusBarStyle)preferredStatusBarStyle { return

preferredStatusBarStyle isn't called

谁说我不能喝 提交于 2019-11-25 20:11:20
I followed this thread to override -preferredStatusBarStyle , but it isn't called. Are there any options that I can change to enable it? (I'm using XIBs in my project.) AbdullahC Possible root cause I had the same problem, and figured out it was happening because I wasn't setting the root view controller in my application window. The UIViewController in which I had implemented the preferredStatusBarStyle was used in a UITabBarController , which controlled the appearance of the views on the screen. When I set the root view controller to point to this UITabBarController , the status bar changes