【发布时间】:2018-08-04 15:03:58
【问题描述】:
我使用 SectionList 和 stickyheader
我想在一些顶部空间之后制作stickyheader
所以应用 paddingTop 和 contentInset。
这是工作,但是当加载第一次数据时,它会显示顶部空间,如屏幕上方
小滚动空间消失后 contentInset 开始工作。
第一次数据时如何删除空间。
<SectionList
style={{paddingTop:40}}
contentInset={{ top: -40 }}
ListHeaderComponent={this.listHeaderItem}
ref={ (ref) => {this.myRef=ref}}
renderSectionHeader={this.renderSectionHeaderItem}
renderItem={this.renderItem}
showsHorizontalScrollIndicator={false}
ListFooterComponent={this.footer}
bounces={true}
keyExtractor = {(item, index) => index}
stickySectionHeadersEnabled={true}
sections={this.state.sectionData} />
【问题讨论】:
标签: reactjs react-native padding sticky