Android AlertDialog 宽度max
2018-01-19 11:32
155 查看
1、自定义样式
2、宽度
/*宽度 max*/
Window window = alertDialog.getWindow();
WindowManager.LayoutParams layoutParams = window.getAttributes();
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
window.setAttributes(layoutParams);
/*在底部显示*/
window.setGravity(Gravity.BOTTOM);
2、宽度
/*宽度 max*/
Window window = alertDialog.getWindow();
WindowManager.LayoutParams layoutParams = window.getAttributes();
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
window.setAttributes(layoutParams);
/*在底部显示*/
window.setGravity(Gravity.BOTTOM);
相关文章推荐
- Android开发-UI控件:让AlertDialog在按钮被点击后不消失
- Android中阻止AlertDialog关闭实例代码
- android 开发技巧(11)--在 onCreate() 方 法 中 获 取 View 的 宽度和高度
- Android开发--实现对话框(AlertDialog)
- Android官方推荐使用DialogFragment替换AlertDialog
- AlertDialog-----android.view.WindowManager$BadTokenException: Unable to add window
- Android之自定义AlertDialog和PopupWindow实现(仿微信Dialog)
- Android的AlertDialog点击确定后不关闭示例
- Android Paint Stroke某些情况下边框宽度显示一半原因
- android中设置AlertDialog的大小 .
- Android在OnCreate中获取控件的宽度和高度
- Android创建AlertDialog对话框
- Android 根据屏幕的宽度来设置图片的大小,
- Android Dialog设置宽度显示不正常的问题(自定义设置Dialog的宽高)
- Android_ics openmax in stagefright 学习记录------1
- Android在OnCreate中获取控件的宽度和高度
- Android---AlertDialog对话框
- 【转】android获取屏幕宽度和高度
- android中AlertDialog 中setView用法的一些小结
- Android_ics openmax in stagefright 学习记录------1