【发布时间】:2019-12-23 03:00:09
【问题描述】:
在我的 React Native 应用程序中,我有以下代码:
<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>
请注意,aaa 和 bbb <View>s 上有 flexGrow: 1,但它们不会增长以填充垂直空间。如果我将<ScrollView> 换成<View>,孩子们会填满它。这是为什么呢?
【问题讨论】:
标签: react-native flexbox react-native-scrollview