【问题标题】:android studio 3.5 image asset launcher icon (legacy only) shape none not workingandroid studio 3.5 图像资产启动器图标(仅限旧版)形状无不起作用
【发布时间】:2019-08-30 06:05:19
【问题描述】:

刚刚将我的 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

如何做到这一点?

【问题讨论】:

  • 我的问题是当我安装应用程序时前景层会放大
  • 是android studio的bug还是配置错误?

标签: android shapes android-studio-3.5 android-asset-studio


【解决方案1】:

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

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

【讨论】:

  • 有什么想法吗?我们如何创建具有透明背景的图标?
  • 你可以使用矢量资源或者只复制drawable文件夹中的图标
【解决方案2】:

问题出在 android studio 3.5

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

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

【讨论】:

  • 你已经这样做了兄弟...正在寻找任何永久解决方案...谢谢顺便说一句...
【解决方案3】:

在不更新 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 图标在应用程序内部使用(仅限旧版)
  • 我明白了你的问题。在 android studio 3.5 中,您无法通过 Launcher 图标部分导入具有透明 bg 的图像,但您可以使用我的解决方案并对其进行测试。
猜你喜欢
  • 2019-07-12
  • 2011-11-24
  • 1970-01-01
  • 2013-10-07
  • 1970-01-01
  • 2020-12-10
  • 2016-12-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多