Remove navigation bar on Xamarin Forms app with Caliburn.Micro

Brian Sullivan picture Brian Sullivan · Apr 15, 2016 · Viewed 27.8k times · Source

When using the FormsApplication base class with a brand new Xamarin.Forms app using Caliburn.Micro, I end up with an empty navigation bar at the top of my screen. I assume it's being created by Caliburn.Micro somehow, because an out-of-the-box Xamarin.Forms app doesn't have that.

Is there any way I can use Caliburn.Micro with Xamarin.Forms without this navigation bar?

Answer

Keith Rome picture Keith Rome · Apr 16, 2016

I have not used Caliburn.Micro, but I am assuming that it is wrapping your page with a NavigationPage, as what you describe is what would happen if so.

You should be able to hide that navigation bar by setting a simple attribute in your page like so:

<ContentPage NavigationPage.HasNavigationBar="false"
    ..... >
</ContentPage>

If you are not using XAML pages and doing all of your UI in code instead, then you can do it this way within your page constructor:

NavigationPage.SetHasNavigationBar(this, false);