代码:
<View style={{ flex: 1, borderColor: 'orange', borderWidth: 5 }}>
<View style={{ flex: 1, minHeight: 50, backgroundColor: 'skyblue', borderColor: 'blue', borderWidth: 5 }} />
<View style={{ flex: 1, backgroundColor: 'pink', borderColor: 'red', borderWidth: 5 }} />
</View>
截屏:
注意底部的空白区域。两个子视图不填充父视图。这仅在minHeight: 50
添加时发生。空白的高度似乎与 的值相同minHeight
。
环境:
- "世博": "^17.0.0",
- “反应”:“16.0.0-alpha.6”,
- “反应原生”:“ https://github.com/expo/react-native/archive/sdk-17.0.0.tar.gz ”,
真实设备,包括 iPhone 和 Android。