【发布时间】:2020-03-10 16:29:54
【问题描述】:
如何按照 UI 编写代码?我希望两个视图左对齐,一个视图右对齐,三个视图连续。
这是我的代码,它显示所有左对齐
<View style={{
flexDirection: 'row',
flex: 1,
borderTopWidth: isIphoneX() ? 35 : 25,
backgroundColor: color.PRIMARY_COLOR,
padding: 20
}} >
<View style={{ flexDirection: 'column', justifyContent: 'center' }}>
//some content
</View>
<View style={{ flexDirection: 'column', justifyContent: 'center', paddingLeft:8 }}>
//some content
</View>
<View style={{alignSelf:'flex-end' }}>
//some content
</View>
</View>
【问题讨论】:
标签: reactjs react-native flexbox