Reputation: 361
This is my first time I try to implement the flyouts menu in Xamarin forms. I created first a blank page and followed the documentation but for some reason the menu is not showing. The tabbar in case you are wondering will be added dynamically that is why it is empty. What might be the problem? Thanks in advance.
<?xml version="1.0" encoding="utf-8" ?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Bufib.Tools"
xmlns:views="clr-namespace:Bufib.Views.FlyoutPages"
x:Class="Bufib.MainPage">
<Shell.ToolbarItems>
<ToolbarItem x:Name="audioOptn" IconImageSource="{local:ImageResource Bufib.Logos.audio.png}" />
</Shell.ToolbarItems>
<!-- NAVIGATION -->
<Shell.FlyoutHeader>
<StackLayout Padding="10">
<Label x:Name="flyoutHeaderLbl" Text="Bufib" FontSize="Header" />
</StackLayout>
</Shell.FlyoutHeader>
<FlyoutItem x:Name="syllabusPage" >
<Tab>
<ShellContent Route="SyllabusPage" ContentTemplate="{DataTemplate views:SyllabusPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="historyPage">
<Tab>
<ShellContent Route="HistoryPage" ContentTemplate="{DataTemplate views:HistoryPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="managePage">
<Tab>
<ShellContent Route="ManagePage" ContentTemplate="{DataTemplate views:ManagePage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="errorPage">
<Tab>
<ShellContent Route="ErrorPage" ContentTemplate="{DataTemplate views:ErrorPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="aboutPage">
<Tab>
<ShellContent Route="AboutPage" ContentTemplate="{DataTemplate views:AboutPage}" />
</Tab>
</FlyoutItem>
<FlyoutItem x:Name="callUsPage">
<Tab>
<ShellContent Route="CallUsPage" ContentTemplate="{DataTemplate views:CallUsPage}" />
</Tab>
</FlyoutItem>
<!-- END NAVIGATION TABS -->
<!--- TABS -->
<TabBar x:Name="tabBar"></TabBar>
<!--- END TABS -->
</Shell>
Upvotes: 0
Views: 1563
Reputation: 361
The problem was that it was a navigation page. I navigated to it using MainPage = new Navigation(new MainPage()) which causes the problem. So the solution was changing it to MainPage = new MainPage()
Upvotes: 1