【发布时间】:2020-04-01 10:23:22
【问题描述】:
我正在制作一个带有 BottomNavigationBar 的简单 Flutter 应用程序,并且我的 BottomNavigationBarItem 中的标签超过了我点击它时创建的墨水效果。出于某种原因,它似乎只覆盖了图标而不是标签。
如何更改此行为以适应标签?我也希望有一个更矩形的墨水反应。
编辑:
我的导航栏代码
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
selectedItemColor: Colors.blue[900],
unselectedItemColor: Colors.black87,
onTap: onTabTapped,
showUnselectedLabels: true,
currentIndex: _currentIndex,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
title: Text('Home'),
),
BottomNavigationBarItem(
icon: Icon(Icons.collections),
title: Text('Collections'),
),
BottomNavigationBarItem(
icon: Icon(Icons.phone),
title: Text('Recent'),
),
BottomNavigationBarItem(
icon: Icon(Icons.more_horiz),
title: Text('More'),
),
],
),
【问题讨论】:
-
嗨。看来您是 stackoverflow 的新手。如果您没有正确阐述它,人们可能会否决您的问题。如果您提供您正在谈论的代码,您的问题会更好。如果您不知道我在说什么,请阅读有关如何提问的指南。 :)
-
尝试使用BottomAppBar而不是BottoNavigationBar