1.使用Android系统自带的透明效果资源
<Button
android:background
=
"@android:color/transparent"
/>
2.使用ARGB来控制
半透明
<Button android:background="#e0000000"/>
透明
<Button android:background="#00000000"/>
3.设置Alpha
View v = findViewById(R.id.content);
//找到你要设透明背景的layout 的id
v.getBackground().setAlpha(100);//透明度0~255透明度值 ,值越小越透明