Flutter-如何隐藏/删除BottomNavigationBarItem的标题 [英] Flutter - How to hide/remove title of BottomNavigationBarItem

查看:869
本文介绍了Flutter-如何隐藏/删除BottomNavigationBarItem的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个流畅的应用程序,并且我试图隐藏或删除标题。我尝试将标题保留为空字符串,即 new Text(),但这与导航栏的对齐方式弄混了。



所需结果:



解决方案

此问题有两种解决方法,因为此功能尚未实现。


  1. 通过 Container(height:0.0)而不是 Text()

  2. 创建小部件并使用它而不是Flutter的底部导航。 来源

更新:



只需将其添加到您的BottomNavigationBar

  showSelectedLabels:false,
showUnselectedLabels:false,


so i have this flutter app, and i'm trying to hide or remove the title. I tried leaving the title as an empty string i.e. new Text("") but that messed with the alignment of the navbar.

Desired Outcome:

What i'm getting (if i leave the title as empty string):

:

解决方案

There are two workarounds for this problem, as this feature is not yet implemented.

  1. Pass Container(height: 0.0) instead of Text("")
  2. Create widget and use it instead of Flutter's bottom navigation. Source.

Update:

Just add this to your BottomNavigationBar

showSelectedLabels: false,
showUnselectedLabels: false,

这篇关于Flutter-如何隐藏/删除BottomNavigationBarItem的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆