Xamarin.Forms 更改APP图标

Xamarin.Forms Change APP Icon

我的 Visual Studio 2015 年有些奇怪 当我在 Resources --> drawable --> + subs 中更改(甚至不替换)Android 的图标图像时 比我的 visual studio 不会构建一个显示以下错误:

Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon') it points to the AndroidManifest.xml

  <activity android:configChanges="orientation|screenSize" android:icon="@drawable/icon">

如果我恢复到这张地图的旧版本,它会起作用吗? 但这当然不是我们想要的。

请注意资源确实存在并且具有正确的维度等。

有人知道我做错了什么或遗漏了什么吗?

上次我发现自己在追寻特定的错误消息是因为文件名已从 icon 更改为 Icon。它区分大小写。不确定是否是同一个问题,但认为值得一提。

我想如果你使用 Visual Studio 2015,你可以使用在线生成器生成想要的应用程序图标。

然后你把具体生成的图片文件放到

  • 图标-hdpi.png
  • 图标-xhdpi.png
  • 图标-xxhdpi.png

进入您的 Android 项目的特定目录

  • /Resources/drawable-hdpi
  • /Resources/drawable-xhdpi
  • /Resources/drawable-xxhdpi

最后一步是通过 AndroidManifest 文件 select 将插入的图像作为您的应用程序图标。

有关更多信息,请访问 link:

Specify the Application Icon