/**
* An array of child indices determining which children get docked to the
* top of the screen when scrolling. For example passing
* `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the
* top of the scroll view. This property is not supported in conjunction
* with `horizontal={true}`.
*/
stickyHeaderIndices?: number[];
就是这个属性,当滑动列表的时候,能让某个Item悬浮在顶部。
例子:
<FlatList
data={list}
ListHeaderComponent={this.flatListHeader}
renderItem={({ item }) => this.renderItem(item)}
keyExtractor={(item, index) => item.classifyId + index}
stickyHeaderIndices={[1]}
/>
网友评论