Oreo中的自适应图标问题

时间:2018-05-16 15:28:53

标签: android

我正在为我的某个应用程序使用自适应图标。我使用Image Assets创建了自适应图标。在Oreo版本的某些设备上,它工作正常,但在三星手机中它没有显示正确的结果。 我还在我的应用标记中添加了android:roundIcon="@mipmap/ic_launcher"属性,而我的any_dpiv26\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="@color/ic_launcher_background"/> . 
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon> 

其中<color name="ic_launcher_background">#26A69A</color>

我还添加了其中一个正在运行的设备的屏幕截图。虽然在三星它没有工作给定下面的自适应图像,我已经测试使用模拟器和一些其他奥利奥设备,它在那里工作正常。

phone screenshot

1 个答案:

答案 0 :(得分:0)

是的,我在Android Oreo中也遇到了同样的问题。

  

1)通过添加“图像矢量”来添加图像。.File-> New-> Image Asset

  • 别忘了使用缩放使用修剪和调整大小
  • 调整图像

enter image description here

您也可以查看此视频,它将为您提供帮助:

How to Create App Launcher Icon in Android Studio