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

如需转载,请注明出处:Flutter学习笔记(16)--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),
          ],

Flutter学习笔记(39)--BottomNavigationBar底部item超过3个只显示icon,不显示title_第1张图片

加上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,

Flutter学习笔记(39)--BottomNavigationBar底部item超过3个只显示icon,不显示title_第2张图片

 

你可能感兴趣的:(Flutter学习笔记(39)--BottomNavigationBar底部item超过3个只显示icon,不显示title)