Permanently hide navigation bar?

I was wondering how to permanently hide the navigation bar on android devices that have it. I tried using

view.SystemUiVisibility = (StatusBarVisibility)Android.Views.SystemUiFlags.LayoutHideNavigation;
SetContentView(view);

But it didn’t do anything.
Enabling Immerisve mode in the label didn’t do anything either.

Also using graphics.IsFullScreen = true; as suggested in this post doesn’t work for me.

I found it took me a bit of trail and error, seems quite a few suggested ways. I think I ended up doing all the steps you mention, but also created a custom style (make sure to set your activity to use this style)

If you check Resources/Values/Styles.xml

Probably you need to add
<item name="android:windowActionBar">false</item>

There are also a number of other options that could be useful, e.g.
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>

Give that a go if you haven’t already

1 Like

Yes, I unfortunately tried that already. My Style.xml already have all the the items you mention.

Its a bit of a fiddle, especially certain devices can be more tricky.

Couple of suggestions I see looking at a project here. I have split mine intro two activities, an entry one, and then GameActivity which launches monogame. I’m not sure why I did this anymore, but suspect it was for a reason such as issues with fullscreen.

Another is that I use a few more flags than you, this is from the top of my GameActivity

SystemUiFlags flags = SystemUiFlags.HideNavigation | SystemUiFlags.Fullscreen | SystemUiFlags.ImmersiveSticky | SystemUiFlags.Immersive; Window.DecorView.SystemUiVisibility = (StatusBarVisibility)flags; Immersive = true;

I also subscribe to the Window.ClientSizeChanged event, where I again call the above code

Alo see my full style.xml in case it has something extra-

`<?xml version="1.0" encoding="utf-8"?>

false @drawable/Splash true @android:color/transparent true @null true false true @android:color/transparent true true `

Then one other suggestion I have, is if you have not setup a splash screen, in my experience this can be something that effects fullscreen behaviour (I think it mostly effects iOS but it may cause issues on android too). So try making sure you have a proper nine slice splash screen setup, it might help.

1 Like

It worked without creating another activity!! I can’t express how grateful I am, it’s been days since I tried to find a fix. Thank you.

Np, glad you got it working!