Make EditText ReadOnly

前端 未结 22 1295

I want to make a read-only EditText view. The XML to do this code seems to be android:editable=\"false\", but I want to do this in code.

H

22条回答
  •  情话喂你
    2020-12-04 19:06

    android:editable="false" has been deprecated. Therefore you cant use it to make the edit text readonly.

    I have done this using the bellow solution. Here I have used

    android:inputType="none"

    android:textIsSelectable="true"

    android:focusable="false"

    Give it try :)

    
    

提交回复
热议问题