In my React Native app I have the following code:
<View style={{flex: 1}}>
<View style={{backgroundColor: 'black', height: 50}}/>
<ScrollView style={{borderWidth: 1, borderColor: 'red', flex: 1}}>
<Text style={{
borderWidth: 1,
borderColor: 'blue',
flexGrow: 1
}}>aaa</Text>
<Text style={{
borderWidth: 1,
borderColor: 'blue',
flexGrow: 1
}}>bbb</Text>
</ScrollView>
</View>
Note that I have flexGrow: 1
on the aaa
and bbb
<View>
s, but they don't grow to fill the vertical space. If I swap the <ScrollView>
for a <View>
, the children do fill it. Why is this?