【发布时间】:2019-08-31 21:26:57
【问题描述】:
我的测试设备是 Android 6.0。它为所有应用程序使用圆形图标(我的除外)。由于这是唯一的测试设备,而且我的手机没有使用圆形图标,我必须让它在测试设备上运行。
我正在尝试让它显示一个圆形图标,但到目前为止我没有成功。
我已将所有 ic_launcher_round 图片设置为不同的分辨率。我还为“ic_launcher_round.xml”文件创建了一个“app_icon_round”图片。 所有的 ic_launcher_round 图片都是合适的尺寸等等......我已经检查过很多次了。
ic_launcher_round.xml:
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/app_icon_round" />
</adaptive-icon>
AndroidManifest.xml,:
<application
...
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
...
</application>
我总是使用 Android Studio 安装它。我注意到当我在启动画面上工作时,我需要手动卸载应用程序,重新启动手机,然后通过 Android Studio 安装它才能注意到变化。
我想我错过了一些小事,但不知道是什么。我在网上看到的答案并没有提到我没有做的事情。
【问题讨论】:
-
仅供参考 Android 8.0 (API level 26) introduces adaptive launcher icons 和 You should make sure to test your app on devices that support the new circular icons, to see how your circular app icons look and how they are displayed. One way to test your resources is to run the Android emulator and use a Google APIs Emulator System targeting API level 25
-
看看this
-
@HemantParmar hmmmm 好的,但是这款测试手机如何使用圆形图标?我希望它适用于它支持的所有版本(如果我没记错的话,API lvl 22+)。如果我设法找到一些使用它的设备,我会用 8.0+ 测试它。
标签: android icons android-manifest android-icons