Android Studio图像资产启动器图标背景颜色

时间:2022-05-21 08:54:57

I have a .png logo for my app which doesn't have a background, when I add it to android studio as an Image Asset I am forced to have a background. The hex field doesn't accept 8 digit color codes, 6 digits only. Is there anyway to keep the background invisible?

我有一个.png徽标,我的应用程序没有背景,当我将它作为图像资产添加到Android工作室我*有一个背景。十六进制字段不接受8位颜色代码,仅限6位数。无论如何都要保持背景不可见?

3 个解决方案

#1


151  

To make background transparent, set shape as None. See the image below:

要使背景透明,请将形状设置为“无”。见下图:

Android Studio图像资产启动器图标背景颜色

EDIT:

编辑:

For Android Studio 3.0, you can set it from Legacy Tab

对于Android Studio 3.0,您可以从旧版标签中进行设置

Android Studio图像资产启动器图标背景颜色

#2


12  

I'm using Android Studio 3.0.1 and if the above answer doesn't work for you, try to change the icon type into Legacy and select Shape to None, the default one is Adaptive and Legacy.

我正在使用Android Studio 3.0.1,如果上述答案对您不起作用,请尝试将图标类型更改为Legacy并选择Shape to None,默认值为Adaptive和Legacy。

Android Studio图像资产启动器图标背景颜色

Note: Some device has installed a launcher with automatically adding white background in icon, that's normal.

注意:某些设备已经安装了一个启动器,并在图标中自动添加白色背景,这是正常的。

#3


9  

the above approach didn't work for me on Android Studio 3.0. It still shows the background. I just made an empty background file

在Android Studio 3.0上,上述方法对我不起作用。它仍然显示背景。我刚做了一个空背景文件

<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
</vector>

This worked except the full bleed layers

除了完整的出血层外,这个工作正常

#1


151  

To make background transparent, set shape as None. See the image below:

要使背景透明,请将形状设置为“无”。见下图:

Android Studio图像资产启动器图标背景颜色

EDIT:

编辑:

For Android Studio 3.0, you can set it from Legacy Tab

对于Android Studio 3.0,您可以从旧版标签中进行设置

Android Studio图像资产启动器图标背景颜色

#2


12  

I'm using Android Studio 3.0.1 and if the above answer doesn't work for you, try to change the icon type into Legacy and select Shape to None, the default one is Adaptive and Legacy.

我正在使用Android Studio 3.0.1,如果上述答案对您不起作用,请尝试将图标类型更改为Legacy并选择Shape to None,默认值为Adaptive和Legacy。

Android Studio图像资产启动器图标背景颜色

Note: Some device has installed a launcher with automatically adding white background in icon, that's normal.

注意:某些设备已经安装了一个启动器,并在图标中自动添加白色背景,这是正常的。

#3


9  

the above approach didn't work for me on Android Studio 3.0. It still shows the background. I just made an empty background file

在Android Studio 3.0上,上述方法对我不起作用。它仍然显示背景。我刚做了一个空背景文件

<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
</vector>

This worked except the full bleed layers

除了完整的出血层外,这个工作正常