我有一个包含核心组件 SectionList 的 React Native 页面。SectionList 具有粘性节标题 (stickySectionHeadersEnabled) 和列表页脚 (ListFooterComponent)。当用户滚动过去最后一节时,最后一节页眉仍然停留在页面顶部,覆盖页脚。但是,我希望将粘性标题包含在部分列表区域的正文中,而不是在最后一部分结束后保留在屏幕上。
是否可以使用 SectionList 来实现这一点,还是应该采取另一种方法?
展示这种行为的 Expo 小吃(仅限 iOS 和 Android)
https://snack.expo.io/@unstableair/rn-sectionlist-footer-overlay-example
<SectionList
sections={DATA}
keyExtractor={(item, index) => item + index}
renderItem={({ item }) => (<View style={styles.item}><Text style={styles.title}>{item}</Text></View>)}
renderSectionHeader={({ section: { title } }) => (<Text style={styles.header}>{title}</Text>)}
stickySectionHeadersEnabled={true}
ListFooterComponent={<View style={styles.footer}><Text>ListFooterComponent </Text></View>}
/>