Forum Xamarin.Forms

NavigationBar.TitleView does not hide menu icon in UWP.

Goutham_HasProblemsGoutham_HasProblems Member ✭✭
edited May 21 in Xamarin.Forms

This is my NavBar title view:

<NavigationPage.TitleView>
        <StackLayout Margin="0" Padding="6,0,6,0" BackgroundColor="Yellow"
                     Orientation="Horizontal">
            <Button VerticalOptions="Center" ImageSource="backArrow_icon.png"
                    HorizontalOptions="Start"
                    HeightRequest="30" MinimumHeightRequest="30"
                    WidthRequest="30" MinimumWidthRequest="30"/>
            <Label VerticalOptions="Center"
                   HorizontalOptions="StartAndExpand"
                   Text="{x:Static resources:AppResources.Share}"/>
            <Button VerticalOptions="Center" ImageSource="Check_Icon.png"
                    HorizontalOptions="Start"
                    HeightRequest="30" MinimumHeightRequest="30"
                    WidthRequest="30" MinimumWidthRequest="30"/>
        </StackLayout>
    </NavigationPage.TitleView>

How do I make the menu icon marked in red, invisible? or get rid of it?

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    NavigationBar.TitleView does not hide menu icon in UWP.

    Hi, Goutham_HasProblems , is your app is a materdetail app?
    If yes, then you could replace hamburg icon easily. Because in UWP platform, it was render with the button with PaneButton style, And you could find it here. Just copy it to UWP App.xaml file and replace the content property like the following.

       <Application.Resources>
        <ResourceDictionary>
            <Style x:Key="PaneButton" TargetType="Button">
                <Setter Property="FontFamily" Value="{ThemeResource SymbolThemeFontFamily}" />
                <Setter Property="FontSize" Value="20" />
                <Setter Property="Height" Value="48" />
                <Setter Property="Width" Value="48" />
                <Setter Property="Content" Value="&#xE701;" />
            </Style>
        </ResourceDictionary>
    </Application.Resources>
    
  • Goutham_HasProblemsGoutham_HasProblems Member ✭✭
    edited May 22

    Hey @jezh , thanks for responding. I actually don't want the menu icon to be completely removed from my app, just in certain pages.
    I know of the style you have mentioned, and I have used it to customise some hover actions.
    I am fairly new to the whole UWP development scene, and I believe my very approach in implementing the NavBar the way I wanted is wrong. In a mobile application, the user can always swipe and get the MasterPage displayed, which is clearly not possible in an UWP application. Yet, the user must know about the existence of a Master page for navigation no matter where they are present in the app, and hence the need for the menu icon to be displayed as an umbrella for the user's access.

  • jezhjezh Member, Xamarin Team Xamurai

    Yes, it is the case just as you said , for the Master page, the menu icon is the necessary user's access for this type of app.
    Therefore, we do not recommend you to remove or hide this menu icon.

    Thanks for you support for xamarin.

    Best Regards!

  • jezhjezh Member, Xamarin Team Xamurai

    Hi @Goutham_HasProblems ,could you please mark this thread to finish this topic? Thanks in advance. :)

  • Goutham_HasProblemsGoutham_HasProblems Member ✭✭

    Hey @jezh , It may look like our understanding of how the Menu icon for MasterDetailPage should behave with respect to the whole application is right. But, there might be a possibility to actually hide the menu icon, and since that is what is the question is essentially asking, I am gonna leave it open. So, that if someone who actually wants the menu icon to go away may hopefully find that answer here.

Sign In or Register to comment.