【问题标题】:Vertically Stacked Views with Static and Dynamic Heights - React Native具有静态和动态高度的垂直堆叠视图 - React Native
【发布时间】:2018-03-08 04:34:28
【问题描述】:

我正在尝试用带有视图的 React Native 中的 Flexbox 来实现下图所代表的效果,如果你有一个基本的例子,那就太棒了:

【问题讨论】:

  • 我们不在这里编写代码,所以请向我们展示您目前的成果

标签: css reactjs react-native flexbox react-native-flexbox


【解决方案1】:

类似这样的:

<View style={{ flex: 1, flexDirection: 'column'}}>
  <View style={{ height: 70, backgroundColor: 'blue' }}>
  </View>
  <View style={{ height: 70, backgroundColor: 'green' }}>
  </View>
  <View style={{ flex: 1, backgroundColor: 'yellow' }}>
  </View>
</View>

不确定蓝线是否是线条/填充/等,但您应该能够将它们添加到这个 shell 中。

【讨论】:

    猜你喜欢
    • 2023-01-10
    • 2016-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-16
    • 1970-01-01
    • 2015-09-01
    • 2012-01-09
    相关资源
    最近更新 更多