android軟鍵盤問題

  1. //隱藏軟鍵盤 ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(WidgetSearchActivity.this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); //顯示軟鍵盤,控件ID能夠是EditText,TextView ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE)).showSoftInput(控件ID, 0); 
   if (imm.isActive()) {   //若是開啓與關閉互換           imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,InputMethodManager.HIDE_NOT_ALWAYS);    }//關閉軟鍵盤,開啓方法相同,這個方法是切換開啓與關閉狀態的
相關文章
相關標籤/搜索