这是我的BottomNavigationBar的图像。
图标下方有空白。
如何删除空白并让图标填充空白?我尝试将空的Container
传递给title属性,但是空间仍然存在。
这是我的BottomNavigationBar
代码:
new BottomNavigationBar(
items: [
new BottomNavigationBarItem(
icon: new Icon(Icons.home, color: Colors.grey),
title: new Container(),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.search, color: Colors.grey),
title: new Container(),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.add_circle, color: Colors.grey),
title: new Container(),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.star, color: Colors.grey),
title: new Container(),
backgroundColor: Colors.white),
new BottomNavigationBarItem(
icon: new Icon(Icons.person_outline, color: Colors.grey),
title: new Container(),
backgroundColor: Colors.white),
])
答案 0 :(得分:0)
尝试以下操作
bottomNavigationBar: BottomAppBar(
child: new Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
IconButton(icon: Icon(Icons.menu), onPressed: () {//code here},),
IconButton(icon: Icon(Icons.search), onPressed: () {//code here},),
IconButton(icon: Icon(Icons.search), onPressed: () {//code here},),
IconButton(icon: Icon(Icons.search), onPressed: () {//code here},),
],
),
),