Xamarin Forms Android transparent status bar

android, xamarin, xamarin.android, xamarin.forms

Solution

Did you try this ?

<item name="android:windowTranslucentStatus">true</item>

Problem

I have created a Xamarin Forms project and i am unable to change my Android status bar color to transparent. I am changing my colors programmatically in the OnCreate() method of my MainActivity as follow: ``` if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { Window.ClearFlags(WindowManagerFlags.TranslucentStatus); Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); Window.SetStatusBarColor(Color.Transparent); } ``` I tried different colors and it's working fine but "Transparent" is not working at all. I am testing on an API 22. My style.xml is as follow: ``` <style name="MainTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="colorPrimary">@color/blue</item> <item name="colorPrimaryDark">@color/blue</item> <item name="colorAccent">#FF4081</item> <item name="windowActionModeOverlay">true</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> ``` If i set programmatically my color to Purple for example it will work without issue, but if I set it to Transparent, i will get my style.xml color which is blue. If i remove my style.xml ColorPrimaryDark color, i get a gray status bar. What could be the solution?

Original source

Related problems