Make EditText ReadOnly

前端 未结 22 1285

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:24

    android:editable
    

    If set, specifies that this TextView has an input method. It will be a textual one unless it has otherwise been specified. For TextView, this is false by default. For EditText, it is true by default.

    Must be a boolean value, either true or false.

    This may also be a reference to a resource (in the form @[package:]type:name) or theme attribute (in the form ?[package:][type:]name) containing a value of this type.

    This corresponds to the global attribute resource symbol editable.

    Related Methods

提交回复
热议问题