Home > OS >  C# Xamarin : How to change navigation bar color?
C# Xamarin : How to change navigation bar color?

Time:10-03

I just simply want to change the bottom navigation bar's color to match my app's theme.

In which file, where and how can I change it?

For example here

CodePudding user response:

In your Android folder, in MainActivity.cs on method OnCreate, after the LoadApplication(new App()); define your color like this:

var mainColor = Android.Graphics.Color.Rgb(29, 53, 87);

then set it:

if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
   Window.SetNavigationBarColor(mainColor);
}
  • Related