Я использую реагировать-родной-складной , и он работает хорошо, но мне нужно, чтобы складной вид отображался поверх моего flatlist
.
Когда я использую collapsible
видэто будет push down my flatlist
.Я хочу видеть мое складное представление поверх моего flatlist
Это мое складное представление:
collapsibleView() {
return (
<Collapsible collapsed={!this.state.collapsed}>
<View
style={{
justifyContent: 'flex-end',
alignItems: 'flex-end',
paddingRight: 10,
}}>
<View
style={{
marginTop: 10,
width: 68,
height: 134,
backgroundColor: 'white',
shadowColor: 'black',
shadowOffset: {width: 0, height: 2},
shadowOpacity: 0.2,
shadowRadius: 2,
marginBottom: 2,
borderRadius: 4,
}}>
<ScrollView>
<CollapsibleStyle style={styles.popupMonth} text="8월" />
<CollapsibleStyle style={styles.popupMonth} text="9월" />
<CollapsibleStyle style={styles.popupMonth} text="10월" />
<CollapsibleStyle style={styles.popupMonth} text="11월" />
<CollapsibleStyle style={styles.popupMonth} text="12월" />
</ScrollView>
</View>
</View>
</Collapsible>
);
}
Это мой код с плоским списком:
render() {
return (
<View style={styles.container}>
{this.customHeaderHandler()}
{this.collapsibleView()}
<FlatList
data={this.state.data}
renderItem={this.renderItem}
keyExtractor={(item, index) => index.toString()}
ItemSeparatorComponent={this.renderSeparator}
refreshing={this.state.refreshing}
onRefresh={this.handleRefresh}
/>
</View>
);
}
Мой взгляд будет выглядеть так: