React native 安卓系统(而非ios)中的文本降低和截断-react native
文本应该是这样的 但在Android上,它看起来是这样的: 文本和容器的样式代码为:React native 安卓系统(而非ios)中的文本降低和截断-react native,react-native,React Native,文本应该是这样的 但在Android上,它看起来是这样的: 文本和容器的样式代码为: text: { fontFamily: 'Roboto', fontSize: 40, width: 250, height: 40, textAlignVertical: 'center', textAlign: 'center', }, container: { backgroundColor: '#DDDDDD', width: 250, height: 55,
text: {
fontFamily: 'Roboto',
fontSize: 40,
width: 250,
height: 40,
textAlignVertical: 'center',
textAlign: 'center',
},
container: {
backgroundColor: '#DDDDDD',
width: 250,
height: 55,
margin: 12.5,
borderRadius: 10,
justifyContent: 'center'
}
以及组成部分:
<TouchableOpacity
style={styles.container}
onPress={_ => this.navigation.push('Join')} >
<Text style={styles.text}>Join</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.container}
onPress={_ => this.navigation.push('Create')} >
<Text style={styles.text}>Create</Text>
</TouchableOpacity>
this.navigation.push('Join')}>
参加
this.navigation.push('Create')}>
创造
用以下内容替换您的样式
:
text: {
fontFamily: 'Roboto',
fontSize: 40,
textAlignVertical: 'center',
textAlign: 'center',
},
container: {
backgroundColor: '#DDDDDD',
margin: 12.5,
borderRadius: 10,
justifyContent: 'center',
alignSelf: 'center',
width: 250,
},
将您的
样式更改为下面的-
text: {
fontFamily: 'Roboto',
fontSize: 40,
textAlignVertical: 'center',
textAlign: 'center',
},
container: {
backgroundColor: '#DDDDDD',
width: 250,
minHeight: 55,
margin: 12.5,
borderRadius: 10,
justifyContent: 'center'
alignItems: 'center',
alignSelf: 'center',
}