I included the material topic in my Xamarin.Forms project with the following code, but on Android (Lollipop and Marshmallow) the top status bar (where the clock, signal, battery, etc.) is located, it always remains black. I already read a lot of forums and blogs, tried to combine many times, but I can’t get this status bar in different ways as I want.
MainActivity.cs
[Activity(Theme = "@style/MyTheme", Label = "MyApp", Icon = "@drawable/AppIcon", ScreenOrientation = ScreenOrientation.Portrait, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
<strong> values-V21 / style.xml
<resources>
<style name="MyTheme.Splash" parent="android:Theme.Material.Light">
<item name="android:windowBackground">@drawable/SplashScreen</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="MyTheme" parent="android:Theme.Material.Light">
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
<item name="android:colorPrimary">@color/Brand</item>
<item name="android:textColorPrimary">@color/White</item>
<item name="android:statusBarColor">@color/BrandDark</item>
<item name="android:colorPrimaryDark">@color/BrandDark</item>
<item name="android:colorAccent">@color/Brand</item>
<item name="android:textColor">@color/Brand</item>
</style>
</resources>
<strong> values /colors.xml
<resources>
<color name="SplashBackground">#f78b2b</color>
<color name="Brand">#f78b2b</color>
<color name="BrandDark">#e47108</color>
<color name="White">#ffffff</color>
</resources>
Thanks for any help!
source
share