Surya
Surya

Reputation: 21

Fully transparent status bar using xamarin

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.

Upvotes: 1

Views: 4697

Answers (4)

Abdul Wasey
Abdul Wasey

Reputation: 41

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);

            }

        }

    ```

Upvotes: 3

Ieromin
Ieromin

Reputation: 21

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>

Upvotes: 2

Damien Doumer
Damien Doumer

Reputation: 2266

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>

Upvotes: 0

mark333...333...333
mark333...333...333

Reputation: 1360

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

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

Upvotes: 0

Related Questions