So I'm working on a mobile mapping application where the user flow is like this:
1) User gets presented with set of tiles
2) User taps any elements
3) User swipes to continue to the next tile.
The code is based off http://rnplay.org/apps/psad7g (posting this because you can reproduce it by scrolling and tapping on the cards here, so a potential fix could also be tested here) and is as follows:
<ScrollView
style={styles.mappingContainer}
automaticallyAdjustInsets={false}
horizontal={true}
decelerationRate={0}
snapToInterval={GLOBAL.SCREEN_WIDTH*0.5}
snapToAlignment="start"
contentContainerStyle={styles.wrapper}>
{rows}
</ScrollView>;
A tile is always SCREEN_WIDTH * 0.5, and so I have it snap to the next tile. However, if you tap while the animation is still ongoing, the scroller will reset to the position it came from. Is there any setting I can use to prevent this?
I've looked at increasing the decelerationRate, but that disables the snapping.
Thanks for your help!
Aucun commentaire:
Enregistrer un commentaire