我无法在android和ios上的React Native中将组件居中。Text
View
如您所见,+符号不在白色圆圈的中心。
这是我的组件:
<TouchableOpacity
style={styles.blueButton}
>
<View style={styles.addButton}>
<Text style={styles.plus}>+</Text>
</View>
</TouchableOpacity>
这是我的样式表:
blueButton: {
height: 40,
width: 40,
borderRadius: 3,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#3498DB',
},
addButton: {
width: 15,
height: 15,
borderRadius: 30,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'white',
},
plus: {
color: '#3498DB',
fontSize: 20,
},