1.资源文件设置背景颜色透明度 1)在color.xml文件中定义颜色值,在布局文件中引用
<
color name=
"alpha_blue">
#206d95e5</color>
在布局中使用
android:background=
"@color/alpha_blue"
2)在布局文件中直接使用
android:background=
"#206d95e5"
2.代码设置背景颜色透明度
//找到要设透明背景的布局/控件,通过调用setAlpha函数设置透明度
View v = findViewById(R
.id.content)
v
.getBackground()
.setAlpha(
100)
3.使用android系统中定义的背景全透明
android:background=
"@android:color/transparent"