天天看点

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);