到目前为止我能找到的唯一方法是减少height财产,但问题是它只减少了上面的差距。因此,在您的情况下,您可以尝试将hello文本设置为最小值:
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Text(
'hello',
style: TextStyle(fontSize: 10.0, height: 0.1),
),
Run Code Online (Sandbox Code Playgroud)
使用Stack小部件来对齐文本小部件
Stack(
children: <Widget>[
Text(
'123',
style: TextStyle(fontSize: 60.0),
),
Positioned(
child: Text('Hello'),
bottom: 0.0,
left: 35.0,
)
],
),
Run Code Online (Sandbox Code Playgroud)
希望能帮助到你!
| 归档时间: |
|
| 查看次数: |
306 次 |
| 最近记录: |