Resolve nested Cocos Creator PageView and ScrollView touch conflicts by measuring gesture direction and distance before forwarding horizontal swipes as page changes.
A screen may need horizontal page switching and vertical scrolling at the same time. When a ScrollView is nested inside a PageView, both controls may compete for the same touch gesture.
Nested PageView and ScrollView Structure
The hierarchy in this example is:
Without extra handling, vertical scrolling works inside the white ScrollView area, but horizontal page switching does not.
Detect Horizontal Swipe Gestures
The solution below measures the gesture direction and explicitly changes pages when horizontal movement exceeds a threshold.