Android(安卓)Dialog弹出时背景全透明
16lz
2021-01-26
1:style文件设置
这个属性一定要加,否则在你的dialog周围会有一圈黑色较重的背景,因为你没有设置窗口bei'背景透明(windowBackground).
Dialog全屏设置:
1:(隐藏状态栏)参考上一篇:https://blog.csdn.net/u013908616/article/details/81396497
2:取消dialog自带的padding造成的边框,可添加如下代码
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Window window = getWindow(); window.getDecorView().setPadding(0, 0, 0, 0); WindowManager.LayoutParams layoutParams = window.getAttributes(); layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; layoutParams.height = WindowManager.LayoutParams.MATCH_PARENT; window.setAttributes(layoutParams); }
更多相关文章
- android studio不能运行
- android WebView html网页设置长按的时候不出现复制粘贴
- Android多媒体分析(六)对AudioManager的一点补充
- android设置定时关闭的dialog
- Android实现的视频背景
- Android(安卓)Tab类型主界面总结
- Android(安卓)LinearLayout 点击背景颜色改变
- Android开发菜鸟——RecyclerView
- android 铃声设置流程