How to change menu icon in xamarin forms master detail page

amr_kamalamr_kamal Member ✭✭✭

I'm trying to change menu icon in master page in xamarin forms but nothing changing

this is my code

 public MainNavigationPage()
        {
            InitializeComponent();
            Detail = new NavigationPage(new TabPage());
            Master.Icon = "cart.png";
        }

and in xaml

<MasterDetailPage.Master>
        <ContentPage Title="Menu" Icon="cart.png">
            <StackLayout Padding="20">
                <!-- TODO: // Update the Layout and add some real menu items  -->
                <Button Text="ViewA" BackgroundColor="Black" Command="{Binding NavigateCommand}" CommandParameter="ViewA" />
            </StackLayout>
        </ContentPage>
    </MasterDetailPage.Master>

also i tried this solution in stackoverflow but unfortunately still the same problem

https://stackoverflow.com/questions/47286597/change-hamburger-icon-in-master-detail-navigation-xamarin-forms

Answers

  • BushbertBushbert Member ✭✭✭

    Is you icon in the correct location? i.e. for IOS the resources folder and for Android the Resources/drawable folder

  • amr_kamalamr_kamal Member ✭✭✭

    Yes it is in drawable in android and resources in ios

  • gayanpereragayanperera USMember ✭✭

    the icon does not show exact colour, In IOS by default blue and Android by default grey. is there any way display original color?

Sign In or Register to comment.