我在 popup-window.amEditText
中Button
显示了屏幕底部的弹出窗口。当我尝试在 中输入详细信息时EditText
,弹出窗口隐藏在软键盘后面,看不到EditText
也无法解决问题。任何人都可以帮助我解决这个问题。
弹出窗口代码
search_popup_inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
search_popup_view = search_popup_inflater.inflate(R.layout.search_popup, null, true);
search_popup = new PopupWindow(search_popup_view, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,true);
search = (EditText) search_popup_view.findViewById(R.id.search);
btn_search_enter = (Button) search_popup_view.findViewById(R.id.btn_search);
按钮单击后显示弹出窗口
search_popup.setBackgroundDrawable(new BitmapDrawable());
search_popup.setTouchInterceptor(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
search_popup.dismiss();
return true;
}
return false;
}
});
//search_popup.showAtLocation(findViewById(R.id.line_lay), Gravity.TOP, locateView(view).left, locateView(view).bottom);
search_popup.showAtLocation(findViewById(R.id.line_lay), Gravity.BOTTOM, 0, v.getHeight());