Reactjs 为什么此flexDirection与justifyContent具有相同的视图
我有一些React本机代码如下所示:Reactjs 为什么此flexDirection与justifyContent具有相同的视图,reactjs,react-native,Reactjs,React Native,我有一些React本机代码如下所示: <View style={{flex: 1, flexDirection: 'row', justifyContent: 'space-between'}}> <View style={{width: 50, height: 50, backgroundColor: 'powderblue'}} /> <View style={{width: 50, height: 50, backgroundC
<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>
但两个视图看起来相同,如下图所示:
即使在上面的一个
justifyContent
中设置为space-between
,它显示为好像设置为center
我认为视图之间的空间宽度有限。查看其中的两个视图是什么组件?好的,谢谢,使用alignItems:'center'
的父视图中的两个视图。我已经解决了删除其父视图的样式属性后的问题@佩德罗卡斯蒂略,@paibarmboo