Open weiningtry7 opened 1 month ago
react-native的0.73.7版本中,Android在回调函数使用 Animated.event( [{nativeEvent: {contentOffset: {y: scroll}}}]) 修改scroll的值不生效,后来在
Animated.event( [{nativeEvent: {contentOffset: {y: scroll}}}])
{ useNativeDriver: true, listener: (e: any) => { const y = e.nativeEvent.contentOffset.y; Platform.OS === 'android' && scroll.setValue(y) } 修改,经测试有效,iOS的没问题。
{ useNativeDriver: true, listener: (e: any) => { const y = e.nativeEvent.contentOffset.y; Platform.OS === 'android' && scroll.setValue(y) }
react-native的0.73.7版本中,Android在回调函数使用
Animated.event( [{nativeEvent: {contentOffset: {y: scroll}}}])
修改scroll的值不生效,后来在{ useNativeDriver: true, listener: (e: any) => { const y = e.nativeEvent.contentOffset.y; Platform.OS === 'android' && scroll.setValue(y) }
修改,经测试有效,iOS的没问题。