In Xamarin.Forms app in MainActivity.cs
I set immersive sticky mode:
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
Xamarin.Forms.Forms.Init(this, bundle);
SetFullscreen();
LoadApplication(new App());
}
void SetFullscreen()
{
var uiOptions = (int)Window.DecorView.SystemUiVisibility;
uiOptions |= (int)SystemUiFlags.LowProfile;
uiOptions |= (int)SystemUiFlags.Fullscreen;
uiOptions |= (int)SystemUiFlags.HideNavigation;
uiOptions |= (int)SystemUiFlags.ImmersiveSticky;
Window.DecorView.SystemUiVisibility = (StatusBarVisibility)uiOptions;
Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);
}
When a page with an Entry
(input box) and the keyboard comes up, it goes out of immersive mode and all system bars become visible. When keyboard is hidden, all bars stay visible.
Also using Acr.UserDialogs
with ShowLoading()
.
How to stay in immersive mode all the time? Or how to return to immersive mode when closing the keyboard, and when calling HideLoading()
of UserDialogs
?