Android - 弹出的软键盘,不会覆盖整个界面了哦

autoCompleteTv.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
        autoCompleteTv.setFocusable(true);
        autoCompleteTv.requestFocusFromTouch();
        autoCompleteTv.requestFocus();

        Timer timer = new Timer();
           timer.schedule(new TimerTask() {
               @Override
               public void run() {
                   InputMethodManager m = (InputMethodManager) autoCompleteTv.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                   m.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
               }

           }, 300);


弹出的软键盘,不会覆盖整个界面了哦



隐藏软键盘:


autoCompleteTv.clearFocus();
        InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(autoCompleteTv.getWindowToken(), 0);

你可能感兴趣的:(Android - 弹出的软键盘,不会覆盖整个界面了哦)