ImageButton去边框&Button或者ImageButton的背景透明
来源:互联网 发布:virtualbox ubuntu 编辑:程序博客网 时间:2024/05/16 06:48
在ImageButton中载入图片后,很多人会觉得有图片周围的白边会影响到美观,其实解决这个问题有两种方法
一种方法是将ImageButton的背景改为所需要的图片。如:android:background="@drawable/XXX"
第二种方法就是将ImageButton背景改为透明,这个方法更常用
在XML里;
<ImageButton android:background="#00000000" .../>
注解:颜色和不透明度 (alpha)值以十六进制表示法表示。任何一种颜色的值范围都是 0 到 255(00ff)。对于 alpha,00 表示完全透明,ff表示完全不透明。表达式顺序是“aabbggrr”,其中“aa=alpha”(00 到 ff);“bb=blue”(00 到ff);“gg=green”(00 到 ff);“rr=red”(00 到 ff)。半透明则为
"#e0000000"。例如,如果您希望对某叠加层应用不透明度为 50%的蓝色,则应指定以下值:7fff0000
在代码里:
设置背景图片透明度(超简单)
View v =findViewById(R.id.content);//找到你要设透明背景的layout 的id
v.getBackground().setAlpha(100);//0~255透明度值
- ImageButton去边框&Button或者ImageButton的背景透明
- ImageButton去边框&Button或者ImageButton的背景透明
- Android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- android 设置Button或者ImageButton的背景透明 半透明 透明
- Button或者ImageButton的背景设为透明或者半透明
- Button或者ImageButton的背景设为透明或者半透明
- Button或者ImageButton的背景设为透明或者半透明
- Button或者ImageButton的背景设为透明或者半透明
- Button或者ImageButton的背景设为透明或者半透明
- Button或者ImageButton的背景设为透明或者半透明
- Android中设置Button或者ImageButton的背景透明
- ANDROID+后台Task+Notification++Intent+实例对象的配置
- 本账号不再维护,找我请移步。。。
- D语言之路-第1篇 库函数之争
- Combine algorithm
- 贝塞尔曲线算法的Javascript实现
- ImageButton去边框&Button或者ImageButton的背景透明
- Javascript输出1到100的整数,不用循环,不用递归
- An Introduction to Data Mining
- #XML之路#XSD——complexType
- [Ubuntu + VNC] 配置VNC服务, 配置VNC服务在开机时启动
- 用命令制作Lion的恢复分区
- ubuntu10.04升级到10.10
- HTTP响应
- AJAX教程(1)-创建+XMLHttpRequest+对象