【发布时间】:2018-07-11 17:51:10
【问题描述】:
它有next button,必须在页面中间的absolute position,在它旁边有skip button,文本必须以next button的文本居中。
我正在努力使用flexbox 来实现这一点,也许有人可以帮助我。
到目前为止我的代码是这样的
组件:
<View style={{ alignSelf: 'center', position: 'absolute' }}>
<Button
buttonStyle={styles.nextButton}
onPress={this._onPress}
activeOpacity={0.9}
>
<Text style={styles.nextText}>NEXT</Text>
</Button>
<Text
style={styles.skipButton}
onPress={this._onSkipPress}
>
SKIP
</Text>
</View>
风格:
nextButton: {
backgroundColor: 'white',
height: 52,
width: 128,
borderRadius: 26,
bottom: 24,
elevation: 1
},
skipButton: {
marginRight: 20,
fontSize: 14
},
我知道这是react-native的代码,但是如果你能用css解决它,我相信我可以把它转换成react-native。
注意:请仅使用flexbox
【问题讨论】:
-
分享完整代码
-
@TemaniAfif 完成,但它在
react-native
标签: css react-native flexbox