【发布时间】:2018-11-27 19:33:33
【问题描述】:
我的底部导航栏有问题,该问题仅发生在 iPhone X 上,因为 BNB 下方出现了一些填充,就好像它在 SafeArea 小部件内(而不是)
好吧,我怎样才能删除那个填充?或者以某种方式着色?
这是我的构建函数代码
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: _buildAppBar(),
drawer: _buildDrawer(),
body: _isLoading
? Center(
child: CircularProgressIndicator(),
)
: new Container(
color: Colors.white,
child: _unauthorizedOrders()),
// floatingActionButton: FloatingActionButton(
// onPressed: () {},
// backgroundColor: primaryColor,
// child: Icon(Icons.flash_on, size: 30.0,),
// tooltip: 'Authorize Orders',
// ),
// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
backgroundColor: Colors.red,
bottomNavigationBar: BottomAppBar(
child: Container(
height: 40.0,
color: primaryColor,
child: Row(
children: <Widget>[
// Padding(
// padding: const EdgeInsets.only(left: 10.0),
// child: Text(
// 'Orders: ${orders.length}',
// style: TextStyle(
// color: Colors.white,
// fontSize: 18.0,
// fontWeight: FontWeight.bold),
// ),
// ),
],
),
)),
);
}
编辑:我已将 backgroundColor 添加到脚手架,移除停靠的 FAB 并将主体包裹在容器内以将其涂成白色,但仍然无法正常工作,我已更新上面的代码以显示它
【问题讨论】:
-
也许您最好为此打开一个问题,因为这确实在我看来是个问题。
-
您是否尝试过 Scaffold 中的 resizeToAvoidBottomPadding 属性?脚手架(resizeToAvoidBottomPadding: false, appBar: new AppBar(), );