Solution to event conflict of Android viewpager

Solution to event conflict of Android viewpager

When I did the slide of the pictures in the viewpager yesterday, I found that the pictures did not slide, but the viewpager slid. Later, I checked the information on the Internet to solve the problem of event conflict.

Rewrite dispatchtouchevent() in the child view of viewpager, and then use if statement. When the conditions are met, execute getparent(). Requestdisallowinterceptouchevent (true);, This tells the parent container that it will handle events. The parent container should not block it. That's it.

Thank you for reading, hope to help you, thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>