【发布时间】:2019-10-17 21:27:41
【问题描述】:
我已将AppBar 向下移动,但现在它的高度太大了。我想知道如何从AppBar 的高度中减去状态栏的高度。这是目前的样子:
以下是设置AppBar 高度的方法:
Flutter: Setting the height of the AppBar
以下是获取状态栏高度的方法:
How or where do I change the system status bar Flutter framework
final double statusBarHeight = MediaQuery.of(context).padding.top;
return new Padding(
padding: new EdgeInsets.only(top: statusBarHeight),
child: content
);
我只是不知道如何将这些部分放在一起(我对 Flutter 很陌生,所以请解释清楚答案)
【问题讨论】:
-
您尝试过 PreferredSize 吗?
-
感谢 statusBarHeight,我正在寻找它:D
-
.padding.top得到 0.0