Search code examples
c#androidxamarinmobile-applicationfile-structure

how to reach icon for xamarin menu


I have created menu in Xamarin forms for Android. I only see text, no icons: enter image description here

I think I simply dont know where to put icons correctly to reach them from my menu file. I have files structure like this:

enter image description here

And I try to reach PatientInfo.png from FlyoutMenuPage.xaml file like this:

  <ListView.ItemsSource>
      <x:Array Type="{x:Type local:FlyoutItemPage}">
          <local:FlyoutItemPage Title="Mano duomenys" IconSource="PatientInfo.png" TargetPage="{x:Type local:PatientInfo}"/>
      </x:Array>
  </ListView.ItemsSource>

Where to put my icons (which folder) and how to reach them?


Solution

  • The images should be added in the Resources/drawable directory.

    You can refer to the article about How to set the local image.