Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to change background color of ActionBar of Android?

$
0
0

I learned the sample project MobileCRM(Xamarin.Forms) in order to customize the ActionBar(Android)/NavigationBar(iOS).
On iOS, the sample created a custom render to implement it; on Android, the project used theme of Android.

Unfortunately, when I copy the code of theme and set my application theme, I found that when my app was loading, the ActionBar is blue. However, when it was launched, it become white! You could see the screenshot.

Here is my code of theme:

    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/MyTheme.ActionBarStyle</item>
    </style>
    <style name="MyTheme.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
        <item name="android:titleTextStyle">@style/MyTheme.ActionBar.TitleTextStyle</item>
        <item name="android:background">@color/xamarinblue</item>
        <item name="android:windowActionBar">true</item>
        <item name="android:windowNoTitle">false</item>
    </style>
    <style name="MyTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
        <item name="android:textColor">@android:color/white</item>
    </style>
</resources>

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>