Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Remove Shell Flyout Hamburguer Button WITHOUT disabling Flyout

I currently have this in my AppShell:

<Shell
    x:Class="Fighter_MoveList.AppShell"
    xmlns="http://xamarin.com/schemas/2014/forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:d="http://xamarin.com/schemas/2014/forms/design"
    xmlns:local="clr-namespace:Fighter_MoveList.Views"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="Fighter_MoveList"
    FlyoutBehavior="Flyout"
    FlyoutIcon=""
    FlyoutIsPresented="False"
    mc:Ignorable="d">

    <!--
        Styles and Resources
    -->
    <Shell.Resources>
        <ResourceDictionary>
            <Style x:Key="BaseStyle" TargetType="Element">
                <Setter Property="Shell.BackgroundColor" Value="{StaticResource PrimaryColor}" />
                <Setter Property="Shell.ForegroundColor" Value="White" />
                <Setter Property="Shell.TitleColor" Value="White" />
            </Style>
            <Style BasedOn="{StaticResource BaseStyle}" TargetType="ShellItem" />
        </ResourceDictionary>
    </Shell.Resources>
    <local:RosterPage />
</Shell>

This allows my app to work but it shows a hamburguer button with no content in Android and UWP.
UWP:

I could change the FlyoutBehavior to disabled but this removes the back buttons on UWP, so that's not an option unfortunately.
I tried to change the FlyoutIcon to an empty string hoping the icon would disappear but it didnt.

Best Answer

  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited December 2020 Accepted Answer

    I could change the FlyoutBehavior to disabled but this removes the back buttons on UWP, so that's not an option

    Hi, I tested a basic demo about the function and reproduce the issue on my side. Someone also faced the issue and report this problem on github. Here is the topic link, the issue will be fixed in the Xamarin.Forms 5+ version. Please wait for the release, the 5+pre version doesn't support the function now.

    This allows my app to work but it shows a hamburguer button with no content in Android and UWP.

    If you only want to display one page, it's unncessary to use shell template. You could just use a ContentPage to display the views.


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

Answers

  • YelinzhYelinzh Member, Xamarin Team Xamurai
    edited December 2020 Accepted Answer

    I could change the FlyoutBehavior to disabled but this removes the back buttons on UWP, so that's not an option

    Hi, I tested a basic demo about the function and reproduce the issue on my side. Someone also faced the issue and report this problem on github. Here is the topic link, the issue will be fixed in the Xamarin.Forms 5+ version. Please wait for the release, the 5+pre version doesn't support the function now.

    This allows my app to work but it shows a hamburguer button with no content in Android and UWP.

    If you only want to display one page, it's unncessary to use shell template. You could just use a ContentPage to display the views.


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • albertoha94albertoha94 Member ✭✭✭

    Thanks for the response @Jarvan .
    Yeah I used Shell just because it was the novelty but since this app is simple it doesn't look like it needs it.
    Once I removed I was able to see the back buttons again.
    Still I'll keep in mind that issue on GitHub to see if its solved in the future.

Sign In or Register to comment.