为什么这个带有justifyContent的flexDirection具有相同的视图

时间:2017-04-19 01:27:01

标签: reactjs react-native

我有一些看起来像这样的React Native代码:

    <View style={{flex: 1, flexDirection: 'row', justifyContent: 'space-between'}}>
      <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
      <View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
      <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
    </View>
    <View style={{flex: 1, flexDirection: 'row', justifyContent: 'center'}}>
      <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
      <View style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
      <View style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
    </View>

但两个视图看起来一样,如下图所示:

view on virtual device

即使上述justifyContent设置为space-between,它也会显示为center

0 个答案:

没有答案