I'm trying to change the background color of the Android Toolbar in a Xamarin Forms application.
Expected result:
CurrentResult:
Styles.xml
<resources><stylename="MyTheme" parent="MyTheme.Base">
</style>
<style name="MyTheme.Base"
parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#b71c1c</item>
<item name="android:textColorPrimary">#ffffff</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowBackground">@color/window_background</item>
<item name="toolbarStyle">@style/MyToolBarStyle</item>
</style>
<style name="MyToolBarStyle"
parent="Widget.AppCompat.Toolbar">
<item name="android:background">#b71c1c</item>
<item name="android:colorBackground">#b71c1c</item>
<item name="titleTextAppearance">@style/MyTitleTextAppearance</item>
<item name="subtitleTextAppearance">@style/MySubTitleTextAppearance</item>
</style>
<style name="MyTitleTextAppearance"
parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:background">#ff0000</item>
</style>
<style name="MySubTitleTextAppearance"
parent="TextAppearance.Widget.AppCompat.Toolbar.Subtitle">
<item name="android:textColor">#1976d2</item>
</style>
</resources>
Toolbar.xml
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
android:theme="@style/MyToolBarStyle"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
What is wrong that I can not identify?