如何消除抖动文字上方和下方的间隙 [英] How to remove the gap above and below the text on flutter

查看:81
本文介绍了如何消除抖动文字上方和下方的间隙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将文本"Hello"放在"123"的正下方,但是文本越大,差距越大.我如何消除差距???下面添加了颤动图像.

I am trying to put the text "Hello" right below the "123", but the bigger the text is, the bigger the gap. How do I remove the gap??? Flutter images are added below.

推荐答案

到目前为止,我唯一能找到的方法就是减少height属性,但问题是它缩小了上面的差距.因此,根据您的情况,您可以尝试将hello文本的值设置为最小:

The only way I could find so far is to reduce height property, the problem though is that it reduces the gap above only. So in your case, you could try to set it for hello text to the minimum:

Text(
   '123',
    style: TextStyle(fontSize: 60.0),
),
Text(
   'hello',
    style: TextStyle(fontSize: 10.0, height: 0.1),
),

这篇关于如何消除抖动文字上方和下方的间隙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆