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代码

  1. View v = findViewById(R.id.content);//找到你要设透明背景的layout 的id
  2. v.getBackground().setAlpha(100);//0~255透明度值

android 设置Button或者ImageButton的背景透明 半透明 透明的更多相关文章

  1. Button或者ImageButton的背景设为透明或者半透明

    Button或者ImageButton的背景设为透明或者半透明 半透明<Button android:background="#e0000000" ... /> 透明& ...

  2. Android中Button、ImageButton、ImageView背景设置区别

    Button与ImageButton实际两者无关,Button继承自TextView,不支持src;ImageButton继承自ImageView.同一张图片在不设置大小,默认显示时,使用Button ...

  3. ImageButton去边框&Button或者ImageButton的背景透明

    在ImageButton中载入图片后,很多人会觉得有图片周围的白边会影响到美观,其实解决这个问题有两种方法 一种方法是将ImageButton的背景改为所需要的图片.如:android:backgro ...

  4. Android 按钮 Button和ImageButton

    Button -- 按钮ImageButton -- 图片按钮Button和ImageButton特征1.共有的特征都可以作为一个按钮产生点击事件2.不同点: (1)Button有text属性,Ima ...

  5. Android自定义Button字体颜色和背景颜色

    http://blog.csdn.net/breeze666/article/details/7747649

  6. Android 设置按钮背景透明与半透明_图片背景透明

    Button或者ImageButton的背景设为透明或者半透明 半透明<Button android:background="#e0000000" ... />  透明 ...

  7. 如何设置TextView控件的背景透明度和字体透明度

    如何设置TextView控件的背景透明度和字体透明度 设计师给的标注都是类似这样的: 字号:26 颜色:#000000 透明度:80% 其实,程序上只要需要一个色值就OK了,那么这个色值我如何计算呢? ...

  8. 设置TextView控件的背景透明度和字体透明度

    TextView tv = (TextView) findViewById(R.id.xx); 第1种:tv.setBackgroundColor(Color.argb(255, 0, 255, 0) ...

  9. android设置背景半透明效果

    1.Button或者ImageButton的背景透明或者半透明 半透明:<Button android:background="#e0000000"···> 透明:&l ...

随机推荐

  1. TST fall detection database

    http://www.tlc.dii.univpm.it/blog/databases4kinect#IDFall2

  2. 在虚拟机中安装Ubuntu Server 15.04

    学Linux,上红联! 红联Linux门户|Linux通用技术|Linux发行版技术|Linux企业应用|Linux实验室|红联Linux论坛 Linux系统教程 Linux入门 Linux管理 Li ...

  3. NSAttributedString

    1.    使用这个类,必须先导入CoreText框架. 2.    给UILabel设置attributedText了会导致给UILabel中text,font,textColor,shadowCo ...

  4. SWIFT Button的基本用法

    import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: ...

  5. Mysql复制-Slave库设置复制延迟

    mysql> stop slave; mysql> change master to master_delay=10;#单位是秒 mysql> start slave; mysql& ...

  6. Radius session

    1,EAP 中继 client start, NAS require identity, client sent username, NAS sent username to sever, serve ...

  7. linux:网络yum源和制作本地光盘yum源

    linux:存放yum源的位置:/etc/yum.repos.d/,该目录下全是一些yum源 一.网络yum源: 如图:下面全部都是yum源,后缀是".repo"都是合法的yum源 ...

  8. Java NIO 读数据处理过程

    这两天仿hadoop 写java RPC框架,使用PB作为序列号工具,在写读数据的时候遇到一个小坑.之前写过NIO代码,恰好是错误的代码产生正确的逻辑,误以为自己写对了.现在简单整理一下. 使用NIO ...

  9. PAT 解题报告 1050. String Subtraction (20)

    1050. String Subtraction (20) Given two strings S1 and S2, S = S1 - S2 is defined to be the remainin ...

  10. Leetcode: Arithmetic Slices

    A sequence of number is called arithmetic if it consists of at least three elements and if the diffe ...