Android Studio 3.5 图像资源启动器图标(仅遗留)形状无效。

3

我刚更新了我的Android Studio到3.5版本,尝试使用资源管理器导入一张图片。

选择的文件-

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

这该怎么做呢?

我的问题是,当我安装应用程序时,前景图层会变得缩放。 - alireza easazade
这是 Android Studio 的 bug 还是一些配置错误? - rajesh vaishnav
3个回答

1

有什么想法吗?我们如何创建一个具有透明背景的图标? - rajesh vaishnav
你可以使用矢量资源或者直接复制drawable文件夹中的图标。 - ShahabGT

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文件作为路径。


非常感谢您的回复。 我认为您误解了问题。 我不想创建ic_launcher应用程序标志图标,我只想导入一个带有透明背景的普通图像,以便在应用程序中使用Launcher图标(仅限Legacy)。 - rajesh vaishnav
我收到了你的问题。在Android Studio 3.5中,您无法通过启动器图标部分导入具有透明背景的图像,但是您可以使用我的解决方案并测试它。 - Abbas m

0

问题出在Android Studio 3.5上。

只需更改安装另一个版本的Android Studio 3.4并使用该版本的图像资产创建器来创建应用程序图标。

您无需卸载Android Studio 3.5,只需安装3.4即可用于创建应用程序图标。


你已经做过了,兄弟...我正在寻找任何永久性的解决方案...顺便说一下,谢谢... - rajesh vaishnav

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接