当Animated.createAnimatedComponent(ScrollView)用于创建动画时,ScrollView它不再可能使用scrollTo.
const AnimatedScrollView = Animated.createAnimatedComponent(ScrollView);
<AnimatedScrollView ref={(ref) => this.list = ref}>
<View style={{height: 1000}} />
</AnimatedScrollView>
Run Code Online (Sandbox Code Playgroud)
调用this.list.scrollTo({x: 0, y: 0})会出现以下错误:
_this.list.scrollTo is not a function
它在普通的ScrollView上运行良好.有什么方法可以解决这个问题吗?
react-native ×1