美文网首页
AlertDialog 中有EditText,弹框弹出时不能弹出

AlertDialog 中有EditText,弹框弹出时不能弹出

作者: 小相柳 | 来源:发表于2022-11-08 10:51 被阅读0次
public void show() {
        if (mContext == null) {
            return;
        }
        super.show();
        Window win = getWindow();
        if (win != null) {
            win.setGravity(Gravity.BOTTOM);
            WindowManager.LayoutParams params = win.getAttributes();
            params.width = ScreenUtil.getScreenWidth();
            params.height = WindowManager.LayoutParams.WRAP_CONTENT;
            params.windowAnimations = R.style.BottomPopWinStyle;
            win.setAttributes(params);
            win.setBackgroundDrawable(new BitmapDrawable());
            win.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
            win.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
        }
    }

相关文章

网友评论

      本文标题:AlertDialog 中有EditText,弹框弹出时不能弹出

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