In the current user story at my company, I need to build a component that sits on top of the list, this component is the Header of the FlatList. I need to make the first item, not the Header, stay on top of the Header, but theres text on the Header so that text should be visible too.
I made it with a FlatList inside a ScrollView: - ScrollView - HeaderComponent - FlatList
It works pretty well, the problem is the company that hired me doesn't like that.
When using a ScrollView I also, used position absolute and made the marginTop -80.
I'm using the FlatList prop: ListHeaderComponent/ListHeaderComponentStyle
const concierge = <Concierge type="article" />;
return (
<FlatList
style={styles.container}
data={data}
keyExtractor={(card, i) => `${card.id}_${i}`}
renderItem={this.renderQuickViews}
extraData={cardsContent}
ListHeaderComponent={concierge}
ListHeaderComponentStyle={styles.concierge}
/>
);
I need the Concierge component to be displayed under the first element of the list, but still be seen, the first element can only overlap the Header by like half of it.