在一個Activity中包含多個EditText,如何在用戶點擊或控件獲取焦點時,禁止系統自動彈出軟鍵盤?
可通過設置EditText的 android:focusableInTouchMode="true" 並配合 android:descendantFocusability="beforeDescendants" 在父佈局中控制焦點行為;或在代碼中調用 InputMethodManager.hideSoftInputFromWindow() 主動隱藏輸入法。具體實現細節請參考相關技術文檔。
editText.setShowSoftInputOnFocus(false) (API 21+) 直接禁用特定控件的自動彈出行為。