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

后端 未结 5 715
闹比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:11

    Actually, you do not have to develop this feature by yourself. You just need to use EditText instead TextView, while you set the android:editable of EditText to false. My idea is the same as sandy's.

    My code is here, hope it may help you:

    https://stackoverflow.com/a/11026292/966405

提交回复
热议问题