2
votes

Cannot change the color of my back button in android. In ios, is working very well.

((NavigationPage)Application.Current.MainPage).BackgroundColor = (Color)App.Current.Resources["white"];
((NavigationPage)Application.Current.MainPage).BarBackgroundColor = (Color)App.Current.Resources["white"];
((NavigationPage)Application.Current.MainPage).BarTextColor = (Color)App.Current.Resources["texto"];

Expected: back button color black.

Actual result: back button color white.

2

2 Answers

2
votes

As you can see here, it currently isn't supported and there is an issue open on GitHub. For now, you should use a custom renderer or define a theme in your styles.

0
votes

Add a ToolbarTheme style in your Android project Resources/layout/styles.xml

<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
    <item name="colorControlNormal">@android:color/black</item>
</style>

Then add android:theme="@style/ToolbarTheme" to your Toolbar in Resources/layout/Toolbar.axml