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

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

问题描述

我试图将文本Hello"放在123"的正下方,但文本越大,差距越大.怎么消除缝隙???Flutter 图像添加在下面.

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天全站免登陆