我无法理解为什么我的Xamarin.Forms Android应用程序具有默认的机器人图标。
这是我现在的结构:
以下是“MainActivity.cs”中的内容:
这是我现在的结构:
![enter image description here](https://istack.dev59.com/l2S1j.webp)
[Activity(Label = "My App Name", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
这是我的 "AndroidManifest.xml" 文件中的内容:
<application android:label="My App Name" android:icon="@mipmap/icon"></application>
在 "icon.xml" 文件中:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/launcher_background" />
<foreground android:drawable="@mipmap/icon" />
</adaptive-icon>
我在网上找到一些解决方案建议将图标移动到“drawable”文件夹中,但我不确定这些解决方案是否最新。我使用的是Visual Studio 2019。
icon.png
文件是否具有正确的图像。此外,如果您打开mipmap-anydpi-v26目录中的icon.xml
文件,它是什么样子? - pinedax