Reputation: 21
I'm trying to make the status bar completely transparent like in this picture
but i could only make it like this
i'm getting that transparent black bar even though i'm changing the opacity of the statusbar.
Upvotes: 1
Views: 4697
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
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
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
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