【发布时间】:2018-03-30 17:24:29
【问题描述】:
清单:
<application
android:name="..."
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MyTheme"
tools:replace="icon,label,theme,name,allowBackup">
文件夹下mipmap-anydpi-v26我已经定义了ic_launcher.xml:
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/white"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
build.gradle:
compileSdkVersion = 26
buildToolsVersion = "25.0.2"
supportLibVersion = "25.3.1"
targetSdkVersion = 25
minSdkVersion = 18
而且,我使用的是 android studio 3.0
但最终结果是我得到了一个默认的 android 图标,而不是我提供的那个。
我也尝试将前景 png 放入所有密度文件夹(mipmap-xhdpi 等),尽管我在测试时使用了相同的 png
【问题讨论】:
-
你用的是模拟器还是真机?如果是设备,是什么类型的?
-
在 sdk 26 上使用模拟器,nexus 5x
-
很难说...您是否尝试过更新构建工具?另一件事是模拟器不支持图标变化。
-
@KarolKulbaka 这是构建工具版本,如果您愿意,请将其作为答案提交,否则我会
-
您是否尝试将此
android:roundIcon="@mipmap/ic_launcher_round"添加给您AndroidManifest?看看这个。 Adaptive Icons