设置背景为透明
2014-07-01 16:51
176 查看
三种设置透明的方法,个人比较常用1和3
1、xml中使用Android预设值
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" />
2、xml中使用RGB
半透明<Button android:background="#e0000000" />
透明<Button android:background="#00000000" />
3、java类中设置
View v = findViewById(R.id.content);
v.getBackground().setAlpha(100); //0~255透明度值
1、xml中使用Android预设值
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" />
2、xml中使用RGB
半透明<Button android:background="#e0000000" />
透明<Button android:background="#00000000" />
3、java类中设置
View v = findViewById(R.id.content);
v.getBackground().setAlpha(100); //0~255透明度值
相关文章推荐
- png 设置透明背景
- Iframe设置为透明背景
- 设置CEdit控件背景为透明 C++ MFC
- 去掉ToolStrip设置背景透明后下面蓝色或者灰色的线
- 设置工具栏图标背景颜色为透明
- 如何设置网页的背景为透明
- 忆龙2009:设置label背景透明
- 透明效果,可以设置透明值,做背景
- 关于如何在iframe中设置背景颜色为透明
- iframe设置背景透明
- 将图片的背景设置为透明
- 将文本输入框的背景设置成透明
- 将文本输入框的背景设置成透明
- VC中设置了对话框背景图片的情况下不能正确显示radio控件透明
- Flash透明背景设置
- 设置iframe框架背景透明
- 设置flash的背景为透明
- 给TreeView设置背景图片-------即将TreeView的背景设为透明的方法
- 用ps将图片背景设置为透明
- [转]引用 VC 对话框设置位图背景并透明控件