0
我的文本組件略高於其中的實際文本。是否可以將此文本垂直居中放置在背景中?文本組件中的文本中心文本,React Native
文字是在這裏:
<Text style={styles.container}>{this.props.title}</Text>
風格在這裏:
const styles = StyleSheet.create({
container: {
height: 30,
justifyContent: 'center',
alignItems: 'center',
fontWeight: 'bold',
backgroundColor: '#fff',
}
});
設置'文字一樣'Text'組件高度 – bennygenel
@bennygenel的lineHeight',謝謝您 –
歡迎。很高興它工作 – bennygenel