In a react-native, I have to create a table View which should match the following conditions:
- The first row should be the header where the First & last Items should be sticky and items in the centre can be horizontally scrollable, also, the header should be sticky for vertical scroll.
- From the second row onwards we will have actual data where again, the First & last Items should be sticky and items in the centre can be horizontally scrollable.
- Other than the header table, it should be vertically scrollable including the first & last item of each row, also when scrolling vertically it should look like the complete row is scrolling together.
- Also when the user scrolls horizontally all the items with the header should scroll together and the first & last item of each row should stick at their position.
I can achieve all but the table is either vertically scrollable or horizontally scrollable.
I don't want to use ref because with ref scrolling is not synchronised. Below I am sharing a video of how it's currently working. The only problem is horizontal scrolling which is not synchronised.
Scrolling Table In React-Native
In a react-native, I have to create a table View which should match the following conditions:
- The first row should be the header where the First & last Items should be sticky and items in the centre can be horizontally scrollable, also, the header should be sticky for vertical scroll.
- From the second row onwards we will have actual data where again, the First & last Items should be sticky and items in the centre can be horizontally scrollable.
- Other than the header table, it should be vertically scrollable including the first & last item of each row, also when scrolling vertically it should look like the complete row is scrolling together.
- Also when the user scrolls horizontally all the items with the header should scroll together and the first & last item of each row should stick at their position.
I can achieve all but the table is either vertically scrollable or horizontally scrollable.
I don't want to use ref because with ref scrolling is not synchronised. Below I am sharing a video of how it's currently working. The only problem is horizontal scrolling which is not synchronised.
Scrolling Table In React-Native
Share Improve this question asked Nov 20, 2024 at 11:38 Sandeep MishraSandeep Mishra 6842 gold badges9 silver badges21 bronze badges1 Answer
Reset to default 0Here's how you can go about it
divide layout:
- first row would be its own component with a scroll view, and fixed label
- remaining data in a flatlist, that renders custom data with fixed dates
synchronise list scrolls to enable body scrolling
here's a link to a working example - https://snack.expo.dev/gJJCLlFS0dghuUv6XUlx7
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742361055a4429401.html
评论列表(0条)