How to allow the user to select a text range in a TextView (Similar to EditText)

后端 未结 5 724
闹比i
闹比i 2020-12-08 05:27

I\'ve got a TextView that I would like to allow the user to select a range of text from within it. The TextView takes up the entire width and heigh

5条回答
  •  甜味超标
    2020-12-08 06:27

    You can enable the TextView's Spannable storage. See Highlight Text in TextView or WebView for an example.

    See also:

    http://developer.android.com/reference/android/text/Spanned.html

提交回复
热议问题