[英]soft keyboard is not opening while popup window is open
我創建了帶有edittext的自定義彈出窗口,而我嘗試在edittext軟鍵盤中寫東西時卻沒有出現,
我的代碼,
public void popUpCreateList(final View v) {
View popupView;
final EditText et_list_name;
Button b_add;
LayoutInflater layoutInflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
popupView = layoutInflater.inflate(R.layout.dialog_create_list, null);
popup_create_list = new PopupWindow(popupView,
WindowManager.LayoutParams.FILL_PARENT,
WindowManager.LayoutParams.FILL_PARENT, false);
et_list_name = (EditText) popupView
.findViewById(R.id.dialog_friend_create_list_edt_list_name);
b_add = (Button) popupView
.findViewById(R.id.dialog_friend_create_list_btn_add_list);
new Handler().postDelayed(new Runnable() {
public void run() {
popup_create_list.showAtLocation(v, Gravity.NO_GRAVITY, 0, 0);
popup_create_list.update();
popup_create_list.setFocusable(true);
}
}, 100L);
}
幫我解決問題,謝謝。
你可以試試看。
Your_EditText_Obj.requestFocus();
Your_EditText_Obj.setFocusable(true);
您是否設置了android:windowSoftInputMode="stateVisible
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.