react-native-section-alphabet-list
react-native-section-alphabet-list copied to clipboard
how do you make the section header sticky?
I read your code but I didn't figure out what you've done to make it work.
Probably use stickySectionHeadersEnabled
, check the docs for more: https://reactnative.dev/docs/sectionlist#rendersectionheader
Probably use
stickySectionHeadersEnabled
, check the docs for more: https://reactnative.dev/docs/sectionlist#rendersectionheader
Yes, stickySectionHeadersEnabled
works for me.
<AlphabetList
data={data}
stickySectionHeadersEnabled
indexLetterStyle={styles.indexLetterStyle}
letterListContainerStyle={styles.letterListContainerStyle}
indexLetterContainerStyle={styles.indexLetterContainerStyle}
renderCustomItem={(item) => (
<View style={styles.listItemContainer}>
<Text style={styles.listItemLabel}>{item.value}</Text>
</View>
)}
renderCustomSectionHeader={(section) => (
<View style={styles.sectionHeaderContainer}>
<Text style={styles.sectionHeaderLabel}>{section.title}</Text>
</View>
)}
/>
I've searched the codebase, I didn't find stickySectionHeadersEnabled
appears in it. that's weird.