著作權宣告:本文為xing_star原創文章,轉載請注明出處!
本文同步自http://javaexception.com/archives/224
禁用EditText
這個其實很簡單,最簡單的一種方式,代碼如下
editText.setEnabled(false);那么還有其他的方式么,我想應該是有的,以下的幾個api我并沒有做驗證
editText.setFocusableInTouchMode(false);//不可編輯editText.setKeyListener(null);//不可粘貼,長按不會彈出粘貼框editText.setClickable(false);//不可點擊,但是這個效果我這邊沒體現出來,不知道怎沒用editText.setFocusable(false);//不可編輯
參考資料:
https://blog.csdn.net/qq_36408196/article/details/80271967
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/51798.html
標籤:Android
