[英]How to remove the gap above and below the text on flutter
使用“ Stack
小部件来对齐文本小部件
Stack(
children: <Widget>[
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Positioned(
child: Text('Hello'),
bottom: 0.0,
left: 35.0,
)
],
),
希望能帮助到你!
到目前为止,我能找到的唯一方法是减少height
属性,但问题是它只能减少上面的差距。 所以在你的情况下,你可以尝试将hello
文本设置为最小值:
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Text(
'hello',
style: TextStyle(fontSize: 10.0, height: 0.1),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.