首页 > 解决方案 > React Native ScrollView 不会以最基本的格式滚动^^

问题描述

这是第一次使用 ScrollView,在没有设法让它在我需要的屏幕上工作之后,我制作了新组件只是为了对其进行测试,当我刷新它时,它会在一瞬间在侧面显示滚动条,然后“长度”看起来适合我添加的行数,但我无法滚动它。这就是我的测试的样子^^我做错了什么?将不胜感激

        <View  style={{flex: 1}}>
            <ScrollView>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
                <Text style={{paddingVertical: 30, backgroundColor: 'orange', marginVertical: 10}}>hello</Text>
            </ScrollView>
        </View>
        
    )

标签: react-nativescrollview

解决方案


推荐阅读