Daniel O
Daniel O

Reputation: 2850

Xamarin Forms Android App Keeps hiding action bar

Recently my Xamarin forms Android app has started hiding the top action bar on the main screen. After navigating to a child page it comes back. But this is very bad since the main page's navigation bar also has the menu button which can now never be tapped.

How do I prevent the behaviour that makes this title/action bar slide away and disappear?

Upvotes: 3

Views: 172

Answers (1)

Daniel O
Daniel O

Reputation: 2850

The problem was that I was calling NavigationPage.SetHasNavigationBar(this, false); to get rid of the double nested navigation bar on iPhone. I've fixed it by doing this:

if (Device.RuntimePlatform == Device.Android)
{
    NavigationPage.SetHasBackButton(this, false);
}
else if (Device.RuntimePlatform == Device.iOS)
{
    NavigationPage.SetHasNavigationBar(this, false);
}

Upvotes: 1

Related Questions