我试图将文本(自定义文本按钮)放入 AppBar 的前导属性中。但是,当文本太长时,文本会变成多行
Scaffold(
appBar: AppBar(
centerTitle: true,
leading: Text('Go back to'),
),
)
Run Code Online (Sandbox Code Playgroud)
如何增加 AppBar 前导属性的宽度?
我不想使用标题,因为它使居中标题成为 PITA。
Scaffold(
appBar: AppBar(
centerTitle: true,
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[Text('go back to'), Text('My center title')],
),
),
)
Run Code Online (Sandbox Code Playgroud)
有什么方法可以在不弄乱标题属性的情况下更改它吗?
小智 8
leadingWidth您可以使用以下属性设置自定义前导宽度appBar:
Scaffold(
appBar: AppBar(
leadingWidth: 400,
leading: Text('Go back to'),
centerTitle: true,
title: Text('Center title'),
),
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3786 次 |
| 最近记录: |