Quantcast
Channel: User Liyun Zhang - MSFT - Stack Overflow
Viewing all articles
Browse latest Browse all 446

Answer by Liyun Zhang - MSFT for .NET MAUI: Unwanted whitespace at bottom of screen in Android

$
0
0

This is the default navigation bar for the android. You can put the following code in the OnCreate methoed of the Platforms/Android/MainActivity to hide it:

 protected override void OnCreate(Bundle savedInstanceState)    {        base.OnCreate(savedInstanceState);        this.Window.DecorView.SystemUiVisibility = (StatusBarVisibility)                (SystemUiFlags.ImmersiveSticky | SystemUiFlags.HideNavigation |                 SystemUiFlags.Fullscreen | SystemUiFlags.Immersive);       // old api without showing hide animation       //this.Window.InsetsController.Hide( WindowInsets.Type.SystemBars());        //new api with hide animation    }

=================

You can put the following code in the OnCreate methoed of the Platforms/Android/MainActivity to make the navigation bar transparent:

protected override void OnCreate(Bundle savedInstanceState){   base.OnCreate(savedInstanceState);   Window.SetFlags(WindowManagerFlags.LayoutNoLimits, WindowManagerFlags.LayoutNoLimits);   // this line will make the status bar and navigation bar transparent   Window.SetStatusBarColor(Android.Graphics.Color.Blue);  // this line to keep the status bar color}

Viewing all articles
Browse latest Browse all 446

Trending Articles



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