How to click or tap on a TextView text

后端 未结 8 1701
無奈伤痛
無奈伤痛 2020-11-27 09:52

I know this is so easy (doh...) but I am looking for a way to run a method on tapping or clicking a TextView line of text in an Android App.

I keep thinking about bu

8条回答
  •  感动是毒
    2020-11-27 10:14

    Although you can resolve the problem by setting the listener to textview, it's recommended not to. You should use flat button as it is a subclass of Button and it provides many attributes which TextView doesn't.


    To use flat button, add style="?android:attr/borderlessButtonStyle" attribute -

提交回复
热议问题