FlatList的悬浮setionHeader,ios和android都适用。

/**

     * 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悬浮在顶部。

例子:


         data={list}

          ListHeaderComponent={this.flatListHeader}

          renderItem={({ item }) => this.renderItem(item)}

          keyExtractor={(item, index) => item.classifyId + index}

          stickyHeaderIndices={[1]}

        />

你可能感兴趣的:(FlatList的悬浮setionHeader,ios和android都适用。)