Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

xamarin.forms - Sub menu items appearing on bottom bar and not within the flyout

I am trying to add a sub menu under my flyout but its placing it on the bottom bar instead for some reason.

addonsflayout.Items.Add(new ShellContent {
            Title = "Airliners",
            Icon = "tab_about",
            Content = new AboutPage()
});

addonsflayout.Items.Add(new ShellContent    {
            Title = "Piston Planes",
            Icon = "tab_about",
            Content = new AboutPage()
});
addonsflayout.Items.Add(new ShellContent    {
            Title = "Turbo Props",
            Icon = "tab_about",
            Content = new AboutPage()
        });

My Main shell flyouts are describe as such

<FlyoutItem Title="Addons" x:Name="addonsflayout" Icon="icon_about.png">
    <ShellContent Route="AddonsPage" ContentTemplate="{DataTemplate local:AddonsPage}" />
</FlyoutItem>

<!-- When the Flyout is visible this will be a menu item you can tie a click behavior to  -->
<MenuItem Text="Logout" StyleClass="MenuItemLayoutStyle" Clicked="OnMenuItemClicked">
</MenuItem>

But its placing them in the bottom bar so it is. enter image description here

When I want them here

enter image description here

How does one tell it to show for the side menu and not the bottom bar I am using xamrain forms

Edit 2 While adding FlyoutDisplayOptions="AsMultipleItems" does get it to appear its also adding it to the bottom bar and without indentition in the side menu

<FlyoutItem Title="Addons"  FlyoutDisplayOptions="AsMultipleItems" x:Name="addonsflayout" Icon="icon_about.png">
    <ShellContent Route="AddonsPage" ContentTemplate="{DataTemplate local:AddonsPage}" />
</FlyoutItem>

Piston planes should be further in. Also doing this has removed my main menu item addons.

enter image description here

question from:https://stackoverflow.com/questions/65559727/sub-menu-items-appearing-on-bottom-bar-and-not-within-the-flyout

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...