滚动视图不触发任何滚动事件

Scroll view not fire any scroll events

我使用 React Native 的 Scrollview,这是我的代码:

        <ScrollView 
        onScroll={ e => this.handleOnScroll(e) }
        onMomentumScrollEnd={ e => this.handleOnScroll(e) }
        onContentSizeChange={console.log}
        scrollEventThrottle={1}
        nestedScrollEnabled={true}
        >

所有与滚动相关的事件都没有触发,如何解决? 我也尝试使用 Native Base,但即使是同样的问题,也没有触发任何事件。

解决了,找了很久,解决方法很简单,需要在同一个元素中使用容器,如果只在父元素中是不行的。

        <Container>
            <Content 
            onScroll={ this.handleOnScroll }
            onMomentumScrollEnd={ e => this.handleOnScroll(e) }
            onContentSizeChange={console.log}
            scrollEventThrottle={1}
            nestedScrollEnabled={true}
            >
                <Button onPress={this.getPosts}>
                    <Text>
                        WALL MIX
                    </Text>         
                </Button>
                {   this.state.thePosts.map( (post) => {
                        return <ThePost key={post[0].id} thePost={post} />

                    })
                }
            </Content>
        </Container>