天天看點

Popupwindow裡用EditText擷取焦點彈出軟鍵盤的問題

點選edittext彈出軟鍵盤點選螢幕其他地方軟鍵盤消失      
popView = LayoutInflater.from(context).inflate(R.layout.comment_layout, null);
popupWindow = new PopupWindow(popView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
popupWindow.setBackgroundDrawable(context.getResources().getDrawable(R.color.transparent));
popupWindow.setOutsideTouchable(true);
popupWindow.setFocusable(true);
popupWindow.setSoftInputMode(PopupWindow.INPUT_METHOD_NEEDED);
popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
popupWindow.showAtLocation(view, Gravity.BOTTOM | Gravity.LEFT, 0, 0);
editComment = ((EditText) popView.findViewById(R.id.edit_comment));
editComment.setFocusable(true);