Android全屏设置、控件透明度

1、requestWindowFeature(Window.FEATURE_NO_TITLE);// 隐藏标题,顶部的系统栏不会被覆盖。注意,要放在setcontentview前面,要不然运行会报错。

// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
// WindowManager.LayoutParams.FLAG_FULLSCREEN);// 设置全屏,顶部的系统栏会被覆盖

2、控件名.getBackground().setAlpha(150);//int 在0-255之间值越大,透明度越低

3、 半透明 Button android:background=”#e0000000”
透明 Button android:background=”#00000000”

猜你喜欢

转载自blog.csdn.net/jian11058/article/details/80537122
今日推荐