开发者

How can I prevent swipe in TextView

开发者 https://www.devze.com 2023-04-04 03:50 出处:网络
I have a magazine type app which has TextViews on each of the pages, I need to be abl开发者_开发技巧e to ignore the swipe gesture and pass it to the parent so that when the user drags sideways it move

I have a magazine type app which has TextViews on each of the pages, I need to be abl开发者_开发技巧e to ignore the swipe gesture and pass it to the parent so that when the user drags sideways it moves to the next page instead of trying to scroll the TextView


Did you apply Linkify to the text or another MovementMethod? If so Linkify adds a new MovementMethod , LinkMovementMethod and consumes touch events.

Check Android TextView Linkify intercepts with parent View gestures so you have have link detection and touch events go to the parent

Use Linkify to style the text then override onTouchEvent of the TextView to handle only the links

0

精彩评论

暂无评论...
验证码 换一张
取 消