0

In MonoDroid, how can i hide Navigation and Status Bar completely on a certain action?

So far i tried these lines of codes but without good results.

What i want is to prevent the user from switching out of the application.

Window.RequestWindowFeature(WindowFeatures.NoTitle);
Window.AddFlags(WindowManagerFlags.Fullscreen);
View.SystemUiVisibility = StatusBarVisibility.Hidden;

Thanks in advance!

SlashJ
  • 687
  • 1
  • 11
  • 31

2 Answers2

3
this.Window.AddFlags(WindowManagerFlags.Fullscreen); // hide the status bar
this.Window.ClearFlags(WindowManagerFlags.Fullscreen);  // Show the status bar
Fahad Rehman
  • 1,189
  • 11
  • 25
Ramesh yadav
  • 85
  • 1
  • 15
  • it helped me but made me confuse at first :D . maybe you have to change the comments :) //to show means to remove status bar. //to hide means to show status bar again – jace Nov 09 '16 at 07:33
1

The following link should help you http://developer.xamarin.com/guides/android/user_interface/navigation_bar/

Anees Deen
  • 1,385
  • 2
  • 17
  • 31