制作一个机器人按钮的背景透明, [英] Making a android button’s background translucent,

查看:180
本文介绍了制作一个机器人按钮的背景透明,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,使在 XML code,结果一个Android按钮的背景透明
所以按钮没有背景绘制?


解决方案

 的android:背景=@机器人:彩色/透明

您也可以设置自己的颜色:

 的android:背景=#8000

前两个十六进制字符重新present透明度。因此#00000000是完全透明的。 #8000将是50%透明。 #FF000000是不透明的。

另外6个值是本身的颜色。 #80FF8080是我只是做了一个颜色,是一个半透明的粉红色排序的。

Is there a way to make an android button’s background translucent within xml code,
So the button has no background drawable?

解决方案

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

You can also set your own colors:

android:background="#80000000"

The first two hex characters represent opacity. So #00000000 would be fully transparent. #80000000 would be 50% transparent. #FF000000 is opaque.

The other six values are the color itself. #80FF8080 is a color I just made up and is a translucent sort of pinkish.

这篇关于制作一个机器人按钮的背景透明,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆