Disable EditText editability and focus (like TextView)

后端 未结 7 1365
说谎
说谎 2021-01-02 03:49

Is there a way to make EditText behaviors like TextView in Android (XML is prefered)? I have tried the following:

 android:editable         


        
7条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 04:08

    Now I get a new way. Since I turned off most features of EditText, it should be better to think how to "beautify" the ugly white background of TextView. And the answer is in the source code: Just adding android:background="@android:drawable/edit_text" to a TextView makes the same effects. Thanks again Matthew.

提交回复
热议问题