How can I give textcolor in status bar?

103 Views Asked by At

Text color of the wordings in status bar cannot be changed. Status Bar background color is able to change. How can I change the text color in that?

2

There are 2 best solutions below

0
On

Use -

UIApplication.shared.statusBarStyle = .lightContent // Light content, for use on dark backgrounds

or

UIApplication.shared.statusBarStyle = .default // Dark content, for use on light backgrounds

Don't forget to edit "View controller-based status bar appearance" in info.plist and set it to NO.

0
On

How can I give textcolor in status bar?

You can't!

The only thing that you could do is to change the UIStatusBarStyle, which could be one of the two following options:

  • default:

A dark status bar, intended for use on light backgrounds.

enter image description here

  • lightContent:

A light status bar, intended for use on dark backgrounds.

enter image description here

So, if you are aiming to change the color of the elements in the status bar (black color in first screenshot and white color in second screenshot) to gray -for instance-, that would be not possible, you have to stick of one of the mentioned two options.


How to change the status bar style?

You could check the following answered question to implement it: