【发布时间】:2019-05-27 06:20:09
【问题描述】:
【问题讨论】:
-
如果可以的话,可以给我们看看你的代码吗?
-
为上面的代码添加了一个链接
标签: text flutter widget padding
【问题讨论】:
标签: text flutter widget padding
到目前为止,我能找到的唯一方法是减少 height 属性,但问题在于它仅减少了上面的差距。因此,在您的情况下,您可以尝试将 hello 文本设置为最小:
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Text(
'hello',
style: TextStyle(fontSize: 10.0, height: 0.1),
),
【讨论】:
使用Stack 小部件对齐您的文本小部件
Stack(
children: <Widget>[
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Positioned(
child: Text('Hello'),
bottom: 0.0,
left: 35.0,
)
],
),
希望对你有帮助!
【讨论】: