Android – viewpager.how in viewpager scrolls the parent page converter horizontally instead of scrolling the child nodes, but keeps the child pager scrolling vertically?

I have a parent viewpager, where each page contains a child viewpager. The child viewpager may contain listview or vertical Scrollview. I want to pass the horizontal scrolling of the child viewpager to the parent viewpager, but I want to keep the child viewpager vertically scrollable

Overriding the dispatchtouchevent (motionevent event) in the viewpager and returning false helps to pass the action event to the parent viewpager, but how to keep the listview and Scrollview in the child viewpager scrollable?

resolvent:

The solution is easier than I expected

Just override canscrollhorizontally in the child viewpager and return false

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
分享
二维码
< <上一篇
下一篇>>