The toolbar color is by default white and I would like to change it to blue. I was able to change almost everything but not that.
Toolbar.axml
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
styles.xml
<style name="MyTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:textColorPrimary">#1b2b32</item>
<item name="android:textColorSecondary">#1c4d9e</item>
I found an approach. it is mixed with all the answers I read out there. I used this answer from Change color of ToolBarItem in XAML @Guillermo Daniel Arias. on styles.XML
<item name="android:actionMenuTextColor">#1c4d9e</item>
on App.xml (On xamarin forms share project)
<Style TargetType="NavigationPage">
<Setter Property="BarBackgroundColor" Value="White"/>
<Setter Property="BarTextColor" Value="#004895"/>
</Style>
There are two possible approaches:
BarBackgroundColor
and BarTextColor
of your NavigationPage
. In your case, it would be something like that:MainPage = new NavigationPage(new YourPage())
{
BarBackgroundColor = Color.White,
BarTextColor = Color.Blue
};
android:textColorPrimary
android:textColorSecondary`, try something like that: <style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#FFFFFF</item>
<item name="colorSecondary">#0000FF</item>
<item name="colorAccent">#0000FF</item>
</style>
I think that android:
may be the problem, because I'm doing exactly like I said and it's working.
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