How can I hide the bottom android bar (back button, home button) permanently in xamarin forms? I tried some code but its hiding it temporarily. When I touch the screen, it again shows. But I want to hide it completely.
Touch “Settings” -> “Display” -> “Navigation bar” -> “Buttons” -> “Button layout”. Choose the pattern in “Hide navigation bar” -> When the app opens, the navigation bar will be automatically hidden and you can swipe up from the bottom corner of the screen to show it.
Xamarin. Forms Shell reduces the complexity of mobile application development by providing the fundamental features that most mobile applications require, including: A single place to describe the visual hierarchy of an application. A common navigation user experience.
I appreciate I'm rather late to the party with this answer, but I thought I'd chuck this in here for anyone else who's had the torrid time I've had trying to figure this out.
My Droid MainActivity now looks like this:
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
//====================================
int 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;
//====================================
LoadApplication(new Pages.App());
}
That bit between the commented equals is the sweet spot. Ideally it also needs to be called in the overriden OnStart and OnResume methods as well as OnCreate, to ensure the flags remain set.
If you use "Immersive" rather than "ImmersiveSticky" for that last flag it'll make the top status and bottom system nav bars disappear as required, but when they reappear (from dragging down at the top of the screen, for instance) the bottom one won't disappear again. Therefore using "ImmersiveSticky" is the kiddie.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With