Hi,
I want to change to status bar color (The bar, where the clock and battery status is located).
This is my Code, where the different tabs are defined.
var homeNavigation = new NavigationPage(new Home()); homeNavigation.SetValue(NavigationPage.BarBackgroundColorProperty, Color.Black); homeNavigation.BarBackgroundColor = Color.Black; homeNavigation.BackgroundColor = Color.Black; homeNavigation.Title = "Home";
For reasons, I disabled the NavigationBar NavigationPage.SetHasNavigationBar(this, false);
.
Is it possible to change to status bar color without the navigation bar? And how?
If I enabled the status bar it worked successfully.
Thanks for your help!
Hi @hh-devs,
Yeah we can,
Xamarin.Android:
MainActivity.cs:
if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { Window.ClearFlags(WindowManagerFlags.TranslucentStatus); Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); Window.SetStatusBarColor(Android.Graphics.Color.Rgb(75, 0, 0)); }
Xamarin.iOS:
Add below two permissions in Info.plist
Follow below links
http://motzcod.es/post/110755300272/ios-tip-change-status-bar-icon-text-colors
https://forums.xamarin.com/discussion/comment/71867#Comment_71867
Answers
Hi @hh-devs,
Yeah we can,
Xamarin.Android:
MainActivity.cs:
Xamarin.iOS:
Add below two permissions in Info.plist
Follow below links
http://motzcod.es/post/110755300272/ios-tip-change-status-bar-icon-text-colors
https://forums.xamarin.com/discussion/comment/71867#Comment_71867