美文网首页
PopWindow全屏

PopWindow全屏

作者: 霁逸lei | 来源:发表于2022-09-06 14:27 被阅读0次

计算popView宽高

popupWindow.getContentView().measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
popupView.getMeasuredWidth();

PopWindow全屏

View popupView = View.inflate(context, R.layout.pop_gg_tips, null);
popupWindow = new PopupWindow(popupView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
popupWindow.setOutsideTouchable(true);
popupWindow.setFocusable(true);
//以下两行设置全屏
popupWindow.setClippingEnabled(false);
popupWindow.showAtLocation(tdxAppFuncs.getInstance().getMainActivity().getWindow().getDecorView(), Gravity.CENTER,0, 0);

相关文章

网友评论

      本文标题:PopWindow全屏

      本文链接:https://www.haomeiwen.com/subject/cxbinrtx.html