Flutter学习笔记(39)--BottomNavigationBar底部item超过3个只显示icon,不显示title

如需转载,请注明出处:Flutter学习笔记(39)--BottomNavigationBar底部item超过3个只显示icon,不显示title

          items: [
            _bottomItem(Ids.home, 'ic_home_normal', 'ic_home_selected', 0),
            _bottomItem(Ids.information, 'ic_discovery_normal', 'ic_discovery_selected', 1),
            _bottomItem(Ids.news, 'ic_hot_normal', 'ic_hot_selected', 2),
            _bottomItem(Ids.mine, 'ic_mine_normal', 'ic_mine_selected', 3),
          ],

加上type: BottomNavigationBarType.fixed,即可

items: [
            _bottomItem(Ids.home, 'ic_home_normal', 'ic_home_selected', 0),
            _bottomItem(Ids.information, 'ic_discovery_normal', 'ic_discovery_selected', 1),
            _bottomItem(Ids.news, 'ic_hot_normal', 'ic_hot_selected', 2),
            _bottomItem(Ids.mine, 'ic_mine_normal', 'ic_mine_selected', 3),
          ],
          type: BottomNavigationBarType.fixed,

 

posted @ 2020-07-03 11:29  CurtisWgh  阅读(1244)  评论(0编辑  收藏  举报