首页 > 解决方案 > ScrollView not scrolling properly?

问题描述

There is a ScrollView in my functional component. I am using an android phone connected to my laptop so that I can see the changes in the phone.

Problem:

When I slide on the right side of the phone screen the page scrolls. But when I slide at the center or left side of the phone screen the page does not scroll properly. The page bounces to the top and bottom.

This is my minimalistic code:

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>   
)

I am getting this error in console:

 WARN  VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.

Does anyone know how to solve this problem?

标签: androidtypescriptreact-native

解决方案


nestedScrollEnabled我在里面使用了这个道具ScrollView


推荐阅读