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

2022-11-08  本文已影响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);
        }
    }
上一篇下一篇

猜你喜欢

热点阅读