Reputation: 33
In React-Native, can I make the sticky header in a SectionList stick to an instead of the top? I still want the list to render behind the offset. Also the header should not have a margin on the top when it's not sticking. Is there a way to do this?
Example of how I want the header to stick to the red line (offset):
Upvotes: 1
Views: 1309
Reputation: 231
iOS only, but you can use the contentInset
prop, which is inherited from <ScrollView>
to acheive this.
<SectionList contentInset={{ top: your_offset_amount }} ... />
Upvotes: 1
Reputation: 1326
You can hack it, by creating header with transparent height. For example, header has 100 height, where 80 it`s transparent offset and 20 it content
Upvotes: 0