应用图标启动器未在Android 7.1.1中显示

时间:2018-08-09 22:57:05

标签: android android-7.1-nougat

我们正在实现圆形图标(带有前景和背景)和图标。

<application
    android:allowBackup="false"
    tools:replace="android:allowBackup"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:icon="@mipmap/logo" //normal logo
    android:roundIcon="@mipmap/logo_o" //Our logo with foreground and background
    android:name=".MyApplication"/>

适用于所有版本,但不适用于API 25

enter image description here

下一个代码是背景的前景代码

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@mipmap/logo_background"/>
    <foreground android:drawable="@mipmap/logo_foreground"/>
</adaptive-icon>

4 个答案:

答案 0 :(得分:1)

资源结构:

mipmap-anydpi-v25
   \  ic_launcher_round.xml
mipmap-anydpi-v26
   \  ic_launcher.xml
mipmap-*dpi
   \  ic_launcher.png

AndroidManifest.xml:

<application android:icon="@mipmap/ic_launcher"
             android:roundIcon="@mipmap/ic_launcher_round"

roundIcon资源添加资源重定向,以确保您在API级别26+上拥有v26自适应图标:

values-anydpi-v26
   \  drawables.xml

drawables.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <mipmap name="ic_launcher_round">@mipmap/ic_launcher</mipmap>
</resources>

答案 1 :(得分:0)

就我而言,这是由删除圆形图标的PNG /位图版本引起的。

我只保留了圆形图标的mipmap-anydpi-v26 XML版本。并删除文件夹中的所有圆形图标,例如mipmap-hdpimipmap-mdpi等,以为它们无用。

删除圆形版本的PNG位图后,它可以在除Android 7.1 API级别25之外的所有Android版本(> 4.0)上正常运行。

答案 2 :(得分:0)

您添加其他图标:

enter image description here

清单中

<application
    android:name=".MiseApplication"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"`

答案 3 :(得分:0)

您应该在Android Studio中使用图片资源进行重新生成 对于API 25,您应该生成四舍五入的图标

相关问题