设置背景为透明
来源:互联网 发布:手机怎样发淘宝链接 编辑:程序博客网 时间:2024/06/11 05:52
三种设置透明的方法,个人比较常用1和3
1、xml中使用Android预设值
android:background="@android:color/transparent"
android:background="@android:color/transparent"
例如,
<Button android:background="@android:color/transparent"
android:text="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button android:background="@android:color/transparent"
android:text="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
2、xml中使用RGB
半透明<Button android:background="#e0000000" />
透明<Button android:background="#00000000" />
透明<Button android:background="#00000000" />
3、java类中设置
View v = findViewById(R.id.content);
v.getBackground().setAlpha(100); //0~255透明度值
v.getBackground().setAlpha(100); //0~255透明度值
0 0
- 设置背景为透明
- 设置SurfaceView 背景为透明
- SurfaceView背景设置为透明
- UITableView设置背景为透明
- UITableView设置背景为透明
- 设置picturebox 背景为透明
- UIWebView 设置背景为透明
- dialogFragment设置背景 为透明
- 将图片的背景设置为透明
- 设置flash的背景为透明
- 设置工具栏图标背景颜色为透明
- listview item背景设置为透明
- listview item背景设置为透明
- Android webview背景设置为透明无效
- css 设置元素背景为透明
- Android webview背景设置为透明无效
- listview gridview 设置背景颜色为透明
- Android webview背景设置为透明无效
- 《软件调试的艺术》笔记--使用其他调试工具
- 自己打造Sublime Text 3 开发编辑神器
- 如何解决mysql 中文乱码
- android使用JNI调用C,C++
- Java多线程 阻塞队列和并发集合
- 设置背景为透明
- devstore推荐看球必备的 APP——捧在手心的世界杯
- poj2239 Selecting Courses --- 二分图最大匹配
- amba_device使用分析
- repo命令
- 判断一个数是否是2的方幂
- eclipse怎么打开可视图形界面设计
- Cppcheck 1.54 C/C++静态代码分析工具
- android使用JNI调用C,C++程序