Reputation: 1959
How can I change the software back button layout color at the bottom for xamarin.forms android app? It only shows white color. If we open google photos app we can see that the color is managed. Please refer the images.
1. Xamarin.forms android app with white background for software back button
2. Google Photos app with dark color for software back button layout.
How can we change the color? Any Help is appreciated.
Upvotes: 0
Views: 415
Reputation: 14956
If your Api version is Level 21
or above (Android 5.0
and above).You could use SetNavigationBarColor
method to set the background color.
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
Window.SetNavigationBarColor(Android.Graphics.Color.Red);
}
base.OnCreate(savedInstanceState);
...
}
Upvotes: 1
Reputation: 833
You have to change the Theme of Android app.
tutorial here.
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/theming/theming
Upvotes: 1