9
我想知道为什么我的文本在react-native中得到这些奇怪的padding
。我想尽一切办法来获得完美的文本,但似乎没有任何工作的唯一工作是paddingVertical
和paddingHorizontal
,但它太hacky和不可靠。反应本机Android文本组件额外填充
<Text numberOfLines={1}
style={{
backgroundColor: 'red',
lineHeight: 92,
textAlign: 'center',
textAlignVertical: 'center',
padding: 0,
margin: 0,
fontSize: 92,
color: '#2d76ff',
fontFamily: 'Roboto-Regular',
includeFontPadding: false}}>
{this.state.documents}
</Text>
Zeplin从我的HTC
截图
你能否更新你的问题以添加更多信息?在屏幕截图中,您试图去除的额外填充究竟在哪里? –
你使用自定义字体吗(我不认为Roboto是默认的)?这种行为是特定于Android还是iOS?我在Android上遇到了类似的问题,我发现了一种hacky解决方案:http://stackoverflow.com/questions/41570343 – henkimon