我正在尝试在一些文本中为 textview 绘制圆形 View 。
它可以在 Android 上运行,但是,iOS 无法正常运行。文本位于 View 顶部。
<Text style={styles.na}> NA </Text>
styles
na: {
width: 60,
height: 60,
borderRadius: 60 / 2,
backgroundColor: 'orange',
alignItems: 'center',
textAlign: 'center',
fontWeight: 'bold',
color: 'white',
fontSize: 15,
textAlignVertical: 'center',
marginRight: 10,
overflow: 'hidden',
},
有什么建议吗?
最佳答案
试试这段代码,对我有用
<View style={{
width: 60,
height: 60,
justifyContent: "center",
borderRadius: 60 / 2,
backgroundColor: 'orange',
}}>
<Text style={{
alignSelf: 'center',
fontWeight: 'bold',
color: 'white',
fontSize: 15,
}}>NA</Text>
</View>
关于javascript - 带有中心文本的圆形不工作 React Native iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58765775/