我的功能组件中有一个ScrollView。我正在使用连接到笔记本电脑的Android手机,以便可以看到手机中的更改。
问题:
当我在手机屏幕的右侧滑动时,页面会滚动。但是,当我在手机屏幕的中央或左侧滑动时,页面无法正确滚动。页面会跳到顶部和底部。
这是我的简约代码:
return (
<TouchableWithoutFeedback style={{ flex: 1 }} onPress={Keyboard.dismiss}>
<SafeAreaView>
<Header title="Organizations" navigation={props.navigation} />
<ScrollView>
<Block mb={spacing.huge}>
<Card>
......
<FlatList
.....
/>
......
</Card>
</Block>
</ScrollView>
</SafeAreaView>
</TouchableWithoutFeedback>
)
我在控制台中收到此错误:
WARN VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.
有人知道如何解决这个问题吗?
答案 0 :(得分:0)
我在nestedScrollEnabled
内使用了道具ScrollView
。