1

I'm trying to make the status bar completely transparent like in this picture

enter image description here

but i could only make it like this

enter image description here

i'm getting that transparent black bar even though i'm changing the opacity of the statusbar.

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
Surya
  • 21
  • 1
  • 2

4 Answers4

3

Add this in your OnCreate Method in Xamarin.Android project before calling this method LoadApplication(new App()) :

private void TransparentStatusBar()
        {
            if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
            {
                // for covering the full screen in android..
                Window.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits);

                // clear FLAG_TRANSLUCENT_STATUS flag:
                Window.ClearFlags(WindowManagerFlags.TranslucentStatus);

                Window.SetStatusBarColor(Android.Graphics.Color.Transparent);

            }

        }

    ```
2

Add this in your OnCreate in Xamarin.Android project:

Window.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits);

And add this into your styles.xml in Xamarin.Android project:

<item name="android:fitsSystemWindows">true</item>
Ieromin
  • 21
  • 2
0

I would suggest, you should go directly to android project in your solution.

Here's what I found: Android transparent status bar and actionbar

mark333...333...333
  • 1,270
  • 1
  • 11
  • 26
0

This is easy to achieve, go to your android project, access your styles and add this to your custom style :

<item name="android:windowTranslucentStatus">true</item>
Damien Doumer
  • 1,991
  • 1
  • 18
  • 33