如何在颤动中设置文本行高? [英] How do set text line height in flutter?

查看:94
本文介绍了如何在颤动中设置文本行高?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此在入职"下的材料设计规范"中:此处

So in Material Design Spec under Onboarding: here

指定为:

32sp线高

32sp line height

这是从标题文本的底部到副标题文本的基线的高度.

which is the height from the bottom of the headline text to the base line of the subhead text.

我的问题是,如何才能准确地实现这一点.填充是否足以模仿此规格?还是有其他更准确的方法来做到这一点?

My question is how exactly can this be implemented in flutter. Are padding enough to mimic this spec? or are there other more accurate ways to do this?

推荐答案

是的,TextStyle中还有一个height属性,可让您手动调整线条的高度.

Yes, there is also a height property in TextStyle which allows you to manually adjust the height of the line.

代码段

Text('Hey There', 
  style: TextStyle(height: 5, fontSize: 10),
)

这篇关于如何在颤动中设置文本行高?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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