How to make EditText not editable through XML in Android?

后端 未结 27 1896
梦谈多话
梦谈多话 2020-11-28 17:35

Can anyone tell me how to make an EditText not editable via XML? I tried setting android:editable to false, but

  1. it is de
27条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-28 18:12

    You could use android:editable="false" but I would really advise you to use setEnabled(false) as it provides a visual clue to the user that the control cannot be edited. The same visual cue is used by all disabled widgets and consistency is good.

提交回复
热议问题