1.設置EditText爲不可編輯狀態 直接上代碼:
et_efunction_search_content?.inputType = View.AUTOFILL_TYPE_NONE
et_efunction_search_content?.isFocusable = false
et_efunction_search_content?.isCursorVisible = false
2.修改EditText爲可編輯狀態 直接上代碼:
et_efunction_search_content?.inputType = View.AUTOFILL_TYPE_TEXT
et_efunction_search_content?.isFocusable = true
et_efunction_search_content?.isCursorVisible = true
et_efunction_search_content?.setOnClickListener(null)
3.首次進到頁面默認獲取到焦點並彈窗
et_efunction_search_content.isFocusable = true
et_efunction_search_content.isFocusableInTouchMode = true
et_efunction_search_content.requestFocus()
et_efunction_search_content.findFocus()
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)