ScrollView 不适用于 SimpleAccordian 视图/

ScrollView not working with SimpleAccordian view/

我正在尝试使用组件创建手风琴:来自库:'react-native-simple-accordian'。 但是当手风琴的数量 headers 更多时,我看不到 ScrollView 正常工作。

我的代码:

<View style={{flex:1}}>
        <ScrollView style={{flex:1}}>
            <View style={styles.container}>
                
                        <SimpleAccordion
                            style= {{
                              borderWidth:1,
                              borderRadius:15,
                              margin:3,
                              padding:5,
                              backgroundColor:'#ffffff'
                            }}
                            sections={sectionData}
                            renderHeader= {this.renderHeader}
                            renderContent={this.renderContent}
                            duration={1000}
                            touchableComponent={TouchableOpacity}
                            onChange={this.onChangeAccordian.bind(this)}
                            activeSection={this.state.open}
                        />
            </View>
        </ScrollView>
        </View>

样式object是这样的:

container: {
      flex: 1,
      justifyContent: 'center',
    },

我在这里为 ScrollView 做错了什么样式或定位? react-native

在 react-native ScrollView 的情况下,您可能需要在“contentContainerStyle”道具中提供样式,并且您可能还需要将 flexGrow 的样式 属性 提供给 1

contentContainerStyle = {{
      flexGrow:1
}}