顶视图和底视图高度是固定的,中间视图需要适应剩余 space

Top view and Bottom view heights are fixed, middle view need to fit in remaining space

我有 3 次浏览 top viewmiddle viewbottom viewtop viewbottom view 有它的组件,它们的高度固定在垂直对齐的 container view 中。现在,我需要 middle view 的高度灵活,即 middle view 的高度可以根据屏幕高度而变化,它需要适应剩余的 space。你能帮我解决这个问题吗?

这可能有帮助

<View style={{flex:1}}>

  <View> ... </View> <!-- Top View ->

  <View style={{flex:1}}> ... </View> <!-- Middle View ->

  <View> ... </View> <!-- Bottom View ->

</View>