I'm trying to add an accordion type view in my project and I'm using this library from github Accordion-Collapse-react-native
I was able to successfully integrate the library and it works but the problem is when I put it inside the scrollview it doesn't expand. If I don't put it inside the scrollview it works fine but it doesn't scroll. Not sure what I'm missing. Has anyone used this library? Can anyone help? Below is a sample of my code so far.
<View style={styles.container}>
{/* Question Container */}
<ScrollView
ref={ref => (this.scrollView = ref)}
style={styles.scrollContainer
}
scrollEnabled={scrollEnabled}
onContentSizeChange={this.onContentSizeChange}
>
{this.renderHeaders()}
</ScrollView>
</View>
renderHeaders() {
let headerList = [];
var questionList = [];
questionList = this.props.dataSource[this.props.currentHeading].questions;
for (let i = 0; i < questionList.length; i++) {
headerList.push(
<Collapse>
<CollapseHeader style={styles.headerStyle}>
<Text>{questionList[i].question}</Text>
</CollapseHeader>
<CollapseBody>
<Text>{questionList[i].questionDetail}</Text>
</CollapseBody>
</Collapse>
);
}
return (
<View style={{ flex: 1 }}>
<View>{headerList}</View>
</View>
);
}