代码
android:background="@android:color/transparent"
例如
设置按钮
Java
代码
<Button android:background="@android:color/transparent"
android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff" />
2
、用
ARGB
来控制
Java
代码
半透明
<Button android:background="#e0000000" />
透明
<Button android:background="#00000000" />
3
、设置
alpha
Java
代码
View v = findViewById(R.id.content);//
找到你要设透明背景的
layout
的
id
v.getBackground().setAlpha(100);//0~255
透明度值
android
窗体透明的,黑暗度等的设置技巧
设置透明度(这是窗体本身的透明度,非背景)
1
WindowManager.LayoutParams lp=getWindow().getAttributes();
2
lp.alpha=
0
.