In my app, there is a dark mode, and I would like to know how to change the status bar color? Thanks,
UIColor *color = [UIColor whiteColor];
self.navigationController.navigationBar.barTintColor = color;
This is what worked for me.
click on navigationBar -> style -> Default Then select Translucent and below that Bar Tint -> (select any colour you want)
Ok, according to Apple Docs setStatusBarStyle:animated:
is deprecated since iOS 9.0, and you should now put this code instead:
-(UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
Good luck and happy coding! :)
Add these lines in plist
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With