3

刚刚将我的 android studio 更新到 3.5 尝试使用 assets studio 导入图像。

选择-

icon type : Launcher icons (Legacy only)

name : test_icon

asset type: image

path: path of image having transparent background

trim : no

background : #ffffff

scaling : crop

Shape : None (this is the problem ,it is supposed to show the transparent background image as it is but it still adding white background)

Effect : None

如何才能做到这一点?

4

3 回答 3

1

我实际上也遇到了这个问题,所以我提交了一份报告,他们回答说这不是错误,而是故意的。在这里查看问题:

https://issuetracker.google.com/issues/140183584

于 2019-09-26T21:14:46.530 回答
0

问题出在android studio 3.5

刚刚更改安装了另一个版本的android studio3.4并使用该版本的图像资产创建器来创建应用程序图标。

您不必卸载 android studio 3.5 只需安装 3.4 即可使用它来创建应用程序图标

于 2019-09-08T18:49:51.157 回答
0

要在不更新 Android Studio 的情况下解决此问题:

  1. 您必须ic_launcher_background.xml从具有所需名称的可绘制资源文件夹复制ic_launcher_background_transparent.xml 到计算机中的文件夹。
  2. ic_launcher_background_transparent.xml在编辑模式下打开并添加android:tint="@android:color/transparent"矢量标签。

    <?xml version="1.0" encoding="utf-8"?>
    <vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="108dp"
        android:height="108dp"
        android:viewportWidth="108"
        android:viewportHeight="108"
        android:tint="@android:color/transparent">
    
  3. 然后,右键单击项目并转到New>Image Asset并选择图标类型,Launcher Icons (Adaptive and Legacy)然后在Background Layer选项卡中选择ic_launcher_background_transparent.xml文件作为路径。

于 2019-10-19T15:10:14.627 回答