Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin.Android: Hide StatusBar and Notification in Fullscreen mode

$
0
0

I am trying to hide statusbar and notification in fullscreen mode. User should not be able to pull/swipe down status/notification bar in Xamarin android.

In native android it is working fine with below property.

View decorView = getWindow().getDecorView(); 
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

getWindow().setFlags(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY, WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY);

Equivalent to TYPE_APPLICATION_OVERLAY in xamarin not able to get.

Any solution for Xamarin.Android?

I have tried below properties for xamarin:

View decorView = Window.DecorView;
var uiOptions = (int)decorView.SystemUiVisibility;
var newUiOptions = (int)uiOptions;      
newUiOptions |= (int)SystemUiFlags.HideNavigation;
newUiOptions |= (int)SystemUiFlags.LayoutHideNavigation;
newUiOptions |= (int)SystemUiFlags.LayoutFullscreen;
newUiOptions |= (int)SystemUiFlags.Fullscreen;
newUiOptions |= (int)SystemUiFlags.ImmersiveSticky; 
decorView.SystemUiVisibility = (StatusBarVisibility)newUiOptions;

Window.AddFlags(WindowManagerFlags.TranslucentNavigation);
Window.AddFlags(WindowManagerFlags.TranslucentStatus);
Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen);

Help will be appreciated. Thank you


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>