'Disable child component to take height of parent scroll view
I have a horizontal scroll view and inside of it I've some views:
<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}>
{myData.map((dataObj, index) =>
<MyTestCell />
)}
</ScrollView>
The MyTestCell is a custom component and everything in it inside a <View></View>
Based on the content some MyTestCell are larger in height than others. Is there a way to NOT let MyTestCell View take the height of the longest component?
For example here is a screenshot of the bottom part of a cell which is just there because another cell in the scroll view is of that height:
So, is there a fix to this? Basically, I'm asking if there is a way to absolute the height of a view inside scroll view rather than inheriting the height of its parent it should just keep the height which it requires.
Solution 1:[1]
It might be late but you can do it but setting the flexGrow to 0 on the child component.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jeremy Caney |

