简体   繁体   English

弹出窗口打开时,软键盘未打开

[英]soft keyboard is not opening while popup window is open

I have created custom popup with edittext on it, while i am trying to write something in edittext soft keyboard is not appearing, 我创建了带有edittext的自定义弹出窗口,而我尝试在edittext软键盘中写东西时却没有出现,

my code, 我的代码,

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



}

Help me to resolve the problem, Thanks in advance. 帮我解决问题,谢谢。

You can try this . 你可以试试看。

  1. Your_EditText_Obj.requestFocus();

  2. Your_EditText_Obj.setFocusable(true);

  3. Did you set android:windowSoftInputMode="stateVisible 您是否设置了android:windowSoftInputMode="stateVisible

Soft keyboard doesn't appear 软键盘没有出现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM