【发布时间】:2017-02-05 11:13:22
【问题描述】:
当使用Animated.createAnimatedComponent(ScrollView) 创建动画ScrollView 时,不能再使用scrollTo。
const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView);
<AnimatedScrollView ref={(ref) => this.list = ref}>
<View style={{height: 1000}} />
</AnimatedScrollView>
调用this.list.scrollTo({x: 0, y: 0}) 会出现以下错误:
_this.list.scrollTo is not a function
它在普通的 ScrollView 上工作正常。有没有办法解决这个问题?
【问题讨论】:
标签: react-native