简体   繁体   中英

How to show a ListView in react-native where the rank of a logged in user should always visible

I want to show a ListView in react-native where the rank of a logged in user (let's say "my rank") should always visible with other users list:

If "my rank" is higher then other users (visible users), then show the "my rank" row at the bottom (like a sticky row): Here the row with the blue background is the user of higher rank (my rank row) (Sticky row).

在此输入图像描述

While scrolling, when scrolled users rank reaches the "my rank" (sticky row rank), then the "my rank" (sticky row) should move up as a normal row along with other users. See image (like a normal rank list)

在此输入图像描述

While scrolling, when "my rank" (the one which is scrolling now along with other users) reaches the top of the list, it should stick at the top. So when the user scrolls further, "my rank" row should stick at the top which is always visible.

在此输入图像描述

I want to achieve this using react-native. Please suggest a way to achieve this.

You can use stickyHeaderIndices to achieve this. Refer stickyHeaderIndices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM