admin管理员组

文章数量:1292870

Introduction

I have a FlatList that renders a Tab View in its footer. This Tab View let the user switch between one FlatList or an other. So, these last are sibling FlatLists.

Problem

The first FlatList "A" has a greater height than the second one "B". When I choose the second list, its height is the same as the "A" FlatList's one.

I have reproduced the problem in a snack where you can see a similar code. I recognize that the code is a little long but too simple, just focus only on the parent FlatList (in the App ponent) and the two FlatLists that are rendered in each tab (at the end of the code)

QUESTION

Any ideas how to solve this issue? I don't know if the problem is in the styles or if I have to do something else to make this work (all flatlists have to have their own height, not the greater).

Thank you, I would really appreciate your help.

Introduction

I have a FlatList that renders a Tab View in its footer. This Tab View let the user switch between one FlatList or an other. So, these last are sibling FlatLists.

Problem

The first FlatList "A" has a greater height than the second one "B". When I choose the second list, its height is the same as the "A" FlatList's one.

I have reproduced the problem in a snack where you can see a similar code. I recognize that the code is a little long but too simple, just focus only on the parent FlatList (in the App ponent) and the two FlatLists that are rendered in each tab (at the end of the code)

QUESTION

Any ideas how to solve this issue? I don't know if the problem is in the styles or if I have to do something else to make this work (all flatlists have to have their own height, not the greater).

Thank you, I would really appreciate your help.

Share Improve this question edited Aug 26, 2020 at 22:57 Victor Molina asked Aug 26, 2020 at 22:16 Victor MolinaVictor Molina 2,6613 gold badges28 silver badges59 bronze badges 2
  • why do you need a tab inside FlatList footer? – rishikesh_07 Commented Aug 27, 2020 at 1:33
  • Because when I scroll, the header and TabBar should also go up. – Victor Molina Commented Aug 27, 2020 at 6:48
Add a ment  | 

3 Answers 3

Reset to default 6

UPDATE 2022

  const renderScene = ({ route }) => {
    //
    // 

本文标签: javascriptReact Native Tab view always has the height equal to height of the highest tabStack Overflow