標籤:android popuwindow 鍵盤隱藏顯示
一、鍵盤不消失,popuwindow在下層布局大小不變
popupWindow=new PopupWindow(popuview,LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);// 需要設定一下此參數,點擊外邊可消失 popupWindow.setBackgroundDrawable(new BitmapDrawable()); //設定點擊視窗外邊視窗消失 popupWindow.setOutsideTouchable(true); //設定彈出表單需要軟鍵盤,popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);//再設定模式,和Activity的一樣,覆蓋。popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
二、鍵盤不消失,popuWindow在下層,布局上移
popupWindow=new PopupWindow(popuview,LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);// 需要設定一下此參數,點擊外邊可消失 popupWindow.setBackgroundDrawable(new BitmapDrawable()); //設定點擊視窗外邊視窗消失 popupWindow.setOutsideTouchable(true); //設定彈出表單需要軟鍵盤,popupWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);//再設定模式,和Activity的一樣,覆蓋,調整大小。popupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
三、鍵盤消失
popupWindow=new PopupWindow(popuview,LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);// 需要設定一下此參數,點擊外邊可消失 popupWindow.setBackgroundDrawable(new BitmapDrawable()); //設定點擊視窗外邊視窗消失 popupWindow.setOutsideTouchable(true); popupWindow.setFocusable(true);