I am using Flyout Page which is a start page and wrapped with navigation page. I am getting below navigation bar issue(shows title twice).
Setting my start up page as "MainPage = new MainPage();" will fix the issue but I want it to be navigation page since my app has many pages which is not flyout.
Adding this line of code "NavigationPage.SetHasNavigationBar(this, false);" fixes the issue in Android but not in UWP.
Kindly someone let me know if any workaround is there to fix in UWP.
My code below. MainPage.xaml:
<FlyoutPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="HamburgerMenu.MainPage"
xmlns:local="clr-namespace:HamburgerMenu;assembly=HamburgerMenu"
FlyoutLayoutBehavior="Popover">
<FlyoutPage.Flyout>
<local:MenuPage x:Name="menuPage" IconImageSource="burger_icon.png"/>
</FlyoutPage.Flyout>
<FlyoutPage.Detail>
<NavigationPage>
<x:Arguments>
<local:ContactPage />
</x:Arguments>
</NavigationPage>
</FlyoutPage.Detail>
MainPage.cs:
public partial class MainPage : FlyoutPage
{
public MainPage()
{
NavigationPage.SetHasNavigationBar(this, false);
InitializeComponent();
}
}
ContactPage.xaml:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="HamburgerMenu.ContactPage"
Title="My Title">
<ContentPage.ToolbarItems>
<ToolbarItem Order="Primary" IconImageSource="contacts.png" />
<ToolbarItem Order="Primary" IconImageSource="todo.png" />
</ContentPage.ToolbarItems>
<ContentPage.Content>
<StackLayout>
<Label Text="Iam Content/Detail Page" HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" />
</StackLayout>
</ContentPage.Content>