0

我在 popup-window.amEditTextButton显示了屏幕底部的弹出窗口。当我尝试在 中输入详细信息时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());
4

1 回答 1

1

尝试使用

android:windowSoftInputMode="adjustPan|adjustResize"

在活动清单文件中。

于 2014-07-17T07:21:05.463 回答