I would like to change the status bar background color and text color in iOS to match android.
I found options like this one: MainPage.SetValue(NavigationPage.BarBackgroundColorProperty, Color.Black);
but it does not work.
All the other examples suggest to set the BarBackgroundColor and BarTextColor on the navigation page, but that I believe that it would apply to the navigation bar. Instead i need to change the status bar (the bar where you see the battery status, the clock etc.)
Anyone has done it before? Thx
Answers
The status bar's color will follow the navigation bar's color on iOS so generally, we only manipulate the color of the navigation page's navigation bar.
But if you want to set it separately you have to use Dependency Service to implement it on iOS project.
Create an interface like:
Implement it on iOS:
Please notice we have to add a special key in the info.plist to make the changing text color method work:
And the status text color on iOS only has two colors to be chosen(white and black).
At last, consume this dependency service on Forms: