0
我目前正在尝试为scrollview设置动画,因此它会调整到上面的一个手风琴的高度。我试图通过使用动画来获取scrollView来抵消,但我不断收到错误转换与“translateY”的键必须是一个数字:{“translateY”:0}。如果我将它包装在Animated.View中,动画不再有效?如何向contentContainerStyle添加动画?
<AnimatedScrollView
{...props}
onScroll={Animated.event([
{ nativeEvent: { contentOffset: { y: this.state.scroll } } },
])}
scrollEventThrottle={16}
contentContainerStyle={{
transform: [
{
translateY: this.state.contentOffset,
},
],
}}
>