如何在 Xamarin 菜单中找到图标。

huangapple go评论64阅读模式
英文:

how to reach icon for xamarin menu

问题

我在Xamarin Forms中为Android创建了菜单。 我只看到文本,没有图标:

我认为我简单地不知道在我的菜单文件中正确放置图标以便从中访问它们。 我的文件结构如下:

我尝试从FlyoutMenuPage.xaml文件中像这样访问PatientInfo.png:

<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>

在哪里放置我的图标(哪个文件夹)以及如何访问它们?

英文:

I have created menu in Xamarin forms for Android. I only see text, no icons:
如何在 Xamarin 菜单中找到图标。

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

如何在 Xamarin 菜单中找到图标。

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

  &lt;ListView.ItemsSource&gt;
      &lt;x:Array Type=&quot;{x:Type local:FlyoutItemPage}&quot;&gt;
          &lt;local:FlyoutItemPage Title=&quot;Mano duomenys&quot; IconSource=&quot;PatientInfo.png&quot; TargetPage=&quot;{x:Type local:PatientInfo}&quot;/&gt;
      &lt;/x:Array&gt;
  &lt;/ListView.ItemsSource&gt;

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

答案1

得分: 1

图片应添加到“Resources/drawable”目录中。

您可以参考关于如何设置本地图像的文章

英文:

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

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

huangapple
  • 本文由 发表于 2023年2月23日 19:14:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/75544048.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定