在 Android 中禁用 EditText - Disabling of EditText in Android

問題:

In my application, I have an EditText that the user only has Read access not Write access.在我的應用程序中,我有一個 EditText,用戶只有讀訪問權限沒有寫訪問權限。

In code I set android:enabled="false" .在代碼中我設置了android:enabled="false"

Although the background of EditText changed to dark, when I click on it the keyboard pops up and I can change the text.雖然 EditText 的背景變成了深色,但當我點擊它時,鍵盤會彈出,我可以更改文本。

What should I set to disable EditText?我應該設置什麼來禁用 EditText?


解決方案:

參考一: https://stackoom.com/question/I22l
參考二: Disabling of EditText in Android
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章