-颤振底部导航栏小部件-是否需要设置背景颜色来更改颜色?

时间:2019-06-14 09:42:37

标签: flutter dart widget

我正在设计一个带有底部导航栏的非常简单的flutter应用程序,我对属性的作用有疑问。

首先,我注意到文本的默认颜色是白色,这让我感到惊讶。我遵循的教程的底部导航栏有一个灰色的文本/图标,而我的白色则是白色的。我几乎看不到这些标签。我首先想使用小部件BottomNavigationBar的backgroundColor属性来更改背景颜色,但是它没有用,所以我想出了问题。

bottomNavigationBar: BottomNavigationBar(
        backgroundColor: Colors.blue,
        currentIndex: 0,
        items: [
          BottomNavigationBarItem(
            icon : Icon(
              Icons.home,
            ),
            title: Text('Home'),
          ),
          BottomNavigationBarItem(
            icon : Icon(
              Icons.flight,
            ),
            title: Text('Flights'),
          )
          BottomNavigationBarItem(
            icon : Icon(
              Icons.settings,
            ),
            title: Text('Settings'),
          )

        ],
      ),

那么backgroundColor属性是否应该更改底部导航栏的背景颜色?在“透明”栏上显示白色文本和图标是否正常?

谢谢!

0 个答案:

没有答案