首页 > 解决方案 > 反应原生 ScrollView 不滚动而没有任何错误

问题描述

    <ScrollView contentContainerStyle={styles.list}>
    {pastGuesses.map((guess, index) => renderListItem(guess, pastGuesses.length - index))}
    </ScrollView>



    listContainer: {
        flex: 1,
        width: '80%'
    },
    list: {
        flexGrow: 1,
        alignItems: 'center',
        justifyContent: 'flex-end'
    },
    listItem: {
        borderColor: "#ccc",
        borderWidth: 1,
        padding: 15,
        marginVertical: 10,
        backgroundColor: "#fff",
        flexDirection: 'row',
        justifyContent: 'space-around',
        width: "60%"
    }

在这里,我在本机反应中使用 ScrollView。这是我的代码。但是,不幸的是,滚动不起作用。我没有收到任何错误,但 scorll 没有发生。

请看一下

标签: reactjsreact-native

解决方案


推荐阅读