在开发rn 的时候,存在的者样式的,调整,其实对于一个做客户端的人来说没有什么难度。但是对于一个不是很熟的的客户段开发者来说,在从不熟悉到熟悉的道路上是,有时候一个问题会卡顿很久,所以必要的总结还是有必要的,
首先看下要实现的效果:
一个剧中现实的哦圆角的button
<View style={style.impressTagBox}>
<Button
onPress={this.lookMoreComments}
style={style.lookMoreCommentBtn}
textStyle={style.lookMoreCommentText}
>
{lookMoreCommentText}
</Button>
</View>
css 的样式
lookMoreCommentBtn: {
padding: scaleSize(24),
borderStyle: 'solid',
borderColor: '#4289ff',
borderWidth: p1x,
height: scaleSize(60),
borderRadius: 16,
justifyContent: 'center',
backgroundColor: '#ffffff'
},
lookMoreCommentText: {
fontSize: setSpText(28),
justifyContent: 'center',
color: '#4289ff'
},
impressTagBox: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'center',
padding: scaleSize(24),
marginTop: scaleSize(60),
},
thirdCommentImageArrow: {
height: scaleSize(24),
width: scaleSize(24),
}
这个样式关键是在button 的最外层加了 层标签,同时属性设置成
alignItems: 'center',
justifyContent: 'center',