当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上运行良好.有什么方法可以解决这个问题吗?
有人可以让我知道如何做到这一点,例如在添加时将高度从0设置为动画,在移除时返回0的高度?
我有一个绝对位于ScrollView上方的View:
即使我在顶视图中开始触摸,我也希望能够滚动.我已尝试设置onStartShouldSetResponder并onMoveShouldSetResponder在视图上,false但它仍然不允许我滚动基础ScrollView.任何帮助表示赞赏:)
Realm文档建议使用它们的ListView实现:
import { ListView } from 'realm/react-native';
Run Code Online (Sandbox Code Playgroud)
但我找不到任何关于实际差异是什么以及有什么好处的信息.
每隔一周发布一次新版本的本机版本也不会冒很快过时的风险吗?