我想编写一个用户可以更改配色方案的应用程序。我有 Imagebuttons,按钮上的图像是 png 并且具有透明背景。但是当我把它们放在按钮上时,它们就不再透明了。有人可以帮我一些代码吗? 谢谢! 安妮
最佳答案
您确定设置了 android:background="@null"
吗?否则,您将拥有灰色按钮背景。例如:
<ImageButton
android:background="@null"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/my_transparent_png"
/>
关于Android 图像按钮 : image with tranparent background,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5196149/