Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do you make the section header sticky? #34

Open
chj-damon opened this issue Nov 29, 2021 · 3 comments
Open

how do you make the section header sticky? #34

chj-damon opened this issue Nov 29, 2021 · 3 comments

Comments

@chj-damon
Copy link

I read your code but I didn't figure out what you've done to make it work.

@razinj
Copy link

razinj commented Aug 10, 2022

Probably use stickySectionHeadersEnabled, check the docs for more: https://reactnative.dev/docs/sectionlist#rendersectionheader

@Gaohaoyang
Copy link

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>
  )}
/>

@chj-damon
Copy link
Author

I've searched the codebase, I didn't find stickySectionHeadersEnabled appears in it. that's weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants