Forum Xamarin.Forms

Master detail page icon moving to centre of NavBar when replacing text with img

lwhlwh Member
edited August 2019 in Xamarin.Forms

My master detail menu button looks normal, aligned to the left and just says "menu" without the Icon= line in the code. But as soon as I add the icon, it moves the icon to the middle of the navigation bar and covers the page title.. does anyone know why this is happening? I am stumped

    < MasterDetailPage.Master>
    <ContentPage Padding="20" 
                 BackgroundColor="#cfc9c8"
                 Title="Menu"
                 Icon="burger_menu_icon.png"
                 FlowDirection="LeftToRight"
                 >

Answers

  • HamittirpanHamittirpan Member ✭✭✭✭

    @lwh said:
    My master detail menu button looks normal, aligned to the left and just says "menu" without the Icon= line in the code. But as soon as I add the icon, it moves the icon to the middle of the navigation bar and covers the page title.. does anyone know why this is happening? I am stumped

        < MasterDetailPage.Master>
        <ContentPage Padding="20" 
                     BackgroundColor="#cfc9c8"
                     Title="Menu"
                     Icon="burger_menu_icon.png"
                     FlowDirection="LeftToRight"
                     >
    

    Try using HeightRequest and WidthRequest.

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    I cannot reproduce your issue, If I add your code in my master-detail package, this Burger icon will not change and it will not moving to center like following screenshot. Can you provide a demo to re-produce this issue?

Sign In or Register to comment.