我的BottomNavigationBar
完全是白色的。当有3
图标时,它工作正常,但是当增加到4
时,导航栏将完全变为白色。选项卡仍然可以选择和更改。
这是运行窗口小部件时控制台的输出。
ic=null mNaviBarColor -15724014 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false
这是导航栏的内部版本:
_bottomNavChildren[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
onTap: onTabTapped,
currentIndex: _currentIndex,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.search),
title: Text('Browse'),
),
BottomNavigationBarItem(
icon: Icon(Icons.message),
title: Text('Messages'),
),
BottomNavigationBarItem(
icon: Icon(Icons.person_outline),
title: Text('Profile'),
这是List
小部件,它指向相关的索引类。
int _currentIndex = 0;
final List<Widget> _bottomNavChildren = [
BrowsePage(),
MessagesPage(),
ProfilePage(),
];
谁知道这是什么问题吗?谢谢
BottomNavigationBarType.fixed,当小于四个项目。所选项目使用selectedItemColor呈现如果为非null,则主题的ThemeData.primaryColor为用过的。如果backgroundColor为null,则导航栏的背景颜色默认为“材质”背景颜色ThemeData.canvasColor(基本上是不透明的白色)。
BottomNavigationBarType.shifting,当有四个或更多项目。如果selectedItemColor为null,则所有项目均以白色。导航栏的背景颜色与所选项目的BottomNavigationBarItem.backgroundColor。在这假设每个项目都有不同的背景颜色,并且背景颜色将与白色形成很好的对比。