首页 > 其他分享 >dialog 没有居中或者显示不全(小米手机)

dialog 没有居中或者显示不全(小米手机)

时间:2023-01-31 13:34:52浏览次数:47  
标签:居中 layoutParams WindowManager LayoutParams window dialog article 小米

解决办法
Window window =dialog.getWindow();
// window.setGravity(Gravity.CENTER);
WindowManager.LayoutParams layoutParams = window.getAttributes();
layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
layoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
window.setAttributes(layoutParams);

参考:https://article.itxueyuan.com/O0P9M
https://dandelioncloud.cn/article/details/1503805753193492481

标签:居中,layoutParams,WindowManager,LayoutParams,window,dialog,article,小米
From: https://www.cnblogs.com/kinoyo/p/17078656.html

相关文章