android 设置Button或者ImageButton的背景透明 半透明 透明
Button或者ImageButton的背景设为透明或者半透明
半透明<Button android:background="#e0000000" ... />
透明<Button android:background="#00000000" ... />
颜色和不透明度 (alpha) 值以十六进制表示法表示。任何一种颜色的值范围都是 0 到 255(00 到 ff)。对于 alpha,00 表示完全透明,ff 表示完全不透明。表达式顺序是“aabbggrr”,其中“aa=alpha”(00 到 ff);“bb=blue”(00 到 ff);“gg=green”(00 到 ff);“rr=red”(00 到 ff)。例如,如果您希望对某叠加层应用不透明度为 50% 的蓝色,则应指定以下值:7fff0000
设置背景图片透明度(超简单)
Java代码
- View v = findViewById(R.id.content);//找到你要设透明背景的layout 的id
- v.getBackground().setAlpha(100);//0~255透明度值
android 设置Button或者ImageButton的背景透明 半透明 透明的更多相关文章
- Button或者ImageButton的背景设为透明或者半透明
Button或者ImageButton的背景设为透明或者半透明 半透明<Button android:background="#e0000000" ... /> 透明& ...
- Android中Button、ImageButton、ImageView背景设置区别
Button与ImageButton实际两者无关,Button继承自TextView,不支持src;ImageButton继承自ImageView.同一张图片在不设置大小,默认显示时,使用Button ...
- ImageButton去边框&Button或者ImageButton的背景透明
在ImageButton中载入图片后,很多人会觉得有图片周围的白边会影响到美观,其实解决这个问题有两种方法 一种方法是将ImageButton的背景改为所需要的图片.如:android:backgro ...
- Android 按钮 Button和ImageButton
Button -- 按钮ImageButton -- 图片按钮Button和ImageButton特征1.共有的特征都可以作为一个按钮产生点击事件2.不同点: (1)Button有text属性,Ima ...
- Android自定义Button字体颜色和背景颜色
http://blog.csdn.net/breeze666/article/details/7747649
- Android 设置按钮背景透明与半透明_图片背景透明
Button或者ImageButton的背景设为透明或者半透明 半透明<Button android:background="#e0000000" ... /> 透明 ...
- 如何设置TextView控件的背景透明度和字体透明度
如何设置TextView控件的背景透明度和字体透明度 设计师给的标注都是类似这样的: 字号:26 颜色:#000000 透明度:80% 其实,程序上只要需要一个色值就OK了,那么这个色值我如何计算呢? ...
- 设置TextView控件的背景透明度和字体透明度
TextView tv = (TextView) findViewById(R.id.xx); 第1种:tv.setBackgroundColor(Color.argb(255, 0, 255, 0) ...
- android设置背景半透明效果
1.Button或者ImageButton的背景透明或者半透明 半透明:<Button android:background="#e0000000"···> 透明:&l ...
随机推荐
- Session服务器配置指南与使用经验
一.摘要 所有Web程序都会使用Session保存数据. 使用独立的Session服务器可以解决负载均衡场景中的Session共享问题.本文介绍.NET平台下建立Session服务器的几种办法, 并介 ...
- 网站启动SSL, http变为https后,session验证码错误解决方法
网站启动SSL, http变为https后,session验证码错误解决方法 最近公司需要后台启动安全证书,证书安装完毕后,后台老提示 验证码错误,经过几天的研究,此问题已经得到有效解决,现把方法 ...
- Docker镜像的获取与删除
Docker运行容器前需要本地存在对应的镜像,如果镜像不存在本地,Docker会尝试先从默认镜像仓库下载(默认使用Dicker Hub公共注册服务器中的仓库),用户也可以通过配置,使用自定义的镜像仓库 ...
- Activity的四种启动模式-图文并茂
1.对于使用standard 模式的活动,系统不会在乎这个活动是否已经在返回栈中存在,每次启动都会创建该活动的一个新的实例. 例如A启动A,A再接着启动A,A继续启动A,然后再分别出栈,如图所示 ...
- Eclipse中添加Android系统jar包
这样做的好处是,可以使用Eclipse开发系统应用了,这样可以调用系统中才使用的API. 1.首先在项目中右击->属性.如图所示依次操作 2.添加User Library 3.第一次要新建Use ...
- 随机数产生random
随机数产生推荐用random(),在产生随机数前要添加种子srandom((unsigned int)time(NULL)). SYNOPSIS #include <stdlib.h> l ...
- python get方法
dics.get(k,d)get相当于一条if...else...语句.如果参数k在字典dics中,字典将返回dics[k];返回参数d.例子 >>> l = {:, :} > ...
- linux修改hostname
1.如果只是修改hostname可以通过如下命令 hostname newHostname 注意:这种修改方式只有当前有效,等服务器重启后hostname就会失效,回到原来的hostname. 2.如 ...
- Spring Boot flyway的启动时机比较早
flyway,如果已经创建的版本V1中已经更新,则会validation报错 at org.springframework.boot.devtools.restart.RestartLauncher. ...
- lua metatable 和 _index 实验
lua metatable 和 _index 中文博客解释: http://www.cnblogs.com/simonw/archive/2007/01/17/622032.html metatabl ...