Is there anyway, even if requires platform specific code behind, to change the color of both the top bar (the one in blue) and the bottom bar (the one in black)?
I wish to add support for light and dark modes, so I would like to be able to change that during runtime.
It is possible .
Android:
Using Window.SetStatusBarColor
and Window.SetNavigationBarColor
can do that easily above Android API 21.
if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Lollipop)
{
Window.SetStatusBarColor(Android.Graphics.Color.Orange);
Window.SetNavigationBarColor(Android.Graphics.Color.Orange);
}
IOS:
In ios, change navigation bar and status bar , can use as bellow:
NavigationController.NavigationBar.BarTintColor = UIColor.YouWantColor;
// Color you want, such as UIColor.Green
After click button, changed dynamically to green color.
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