I\'m creating an app where I want to hide the statusbar on a specific page. In my example it\'s a ContentPage. I found several samples where the info.plist is used to hide it, b
You could use a PageRenderer
for this. Here is an example:
public class NoStatusBarPageRenderer : PageRenderer
{
public NoStatusBarPageRenderer()
{
}
public override void ViewWillAppear(bool animated)
{
UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade);
base.ViewWillAppear(animated);
}
public override void ViewDidDisappear(bool animated)
{
UIApplication.SharedApplication.SetStatusBarHidden(false, UIStatusBarAnimation.Fade);
base.ViewDidDisappear(animated);
}
}
Then, for each page that you want to have the status bar hidden, add an attribute to use this renderer on that page.
[assembly: ExportRenderer(typeof(MyContentPage), typeof(NoStatusBarPageRenderer))]