如果您的目标SDK是26,Android设备版本为8,则应用程序图标将是圆形。
其中一种实现方式是(不确定是否是正确/最佳方式):
在AndroidManifest.xml中,我必须设置
android:targetSdkVersion=“20”
<uses-sdk android:minSdkVersion=“16" android:targetSdkVersion=“20” />
android:roundIcon="@mipmap/ic_launcher_round" 表示设置应用程序在圆形图标形式下的图标资源。
<application android:hardwareAccelerated=“true” android:icon=“@mipmap/ic_launcher” android:label=“@string/app_name” android:roundIcon=“@mipmap/ic_launcher_round” android:supportsRtl=“true”>
确保ic_launcher_round图像为正方形。
我使用android studio生成自适应和传统的图标...
我删除了android studio生成的ic_launcher_round图像。
我将ic_launcher图像(通常是正方形图标)复制到ic_launcher_round中。
现在我的ic_launcher_round是正方形图标。
所有这些图像(ic_launcher_round.png、ic_launcher.png、icon.png)都是相同的图像。
完成更改后,重新构建应用程序。现在安装应用程序时,您应该看到正方形图标。