tutton带有图像:删除背景颜色

问题描述 投票:0回答:3
在正常情况下,我会使用

android:background="@null"

并将其解决,但是我将其用作背景模板到我的按钮。

<Button android:drawableLeft="@drawable/profile_32" android:layout_marginRight="25dp" android:layout_marginBottom="10dp" android:textColor="@color/yellow3" android:background="@drawable/buttons2" android:layout_width="match_parent" android:layout_height="60dp" android:text="@string/button_profile" android:textSize="18dp" android:textStyle="bold" android:id="@+id/buttonProfile" /> enter image description here

没有人知道从图像中删除灰色背景颜色的其他方法吗?谢谢

灰色实际上是图像的一部分吗?如果没有,您可以尝试背景:“@android:颜色/透明”


如果灰色背景是

profile_32
android
3个回答
0
投票

是的,使用image tutton,然后添加

0
投票
android:background="#00000000"

or

android:background="@null"

0
投票
到您的按钮。 第一个2“ 0”是alpha,“ 00” =trasparent

android:background="@android:color/transparent"

为了删除背景,请在您的标签中使用此代码
	

© www.soinside.com 2019 - 2025. All rights reserved.