简体   繁体   中英

Status bar style for one view controller

I have set my status bar style to light for my project and it work like charm, but i need to change the style to black for one viewController I'm using this : In my viewDidLoad method, I call: [self setNeedsStatusBarAppearanceUpdate] and set :

- (UIStatusBarStyle) preferredStatusBarStyle { 
       return UIStatusBarStyleBlackTranslucent; }

But my status bar still light.

try in the specific viewContrller you want the status bar normal

- (UIStatusBarStyle) preferredStatusBarStyle { 
   return UIStatusBarStyleDefault; }

这听起来好像您忘记了在信息plist中将UIViewControllerBasedStatusBarAppearance设置为YES

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM