【问题标题】:Flutter BottomNavigationBar Glow on top?Flutter BottomNavigationBar 在顶部发光?
【发布时间】:2020-11-30 10:28:34
【问题描述】:

我遇到的问题是我的 BottomNavigationBar 周围有光。我第一次看到这一点时,我将 BottomNavigationBar 变暗。希望有人可以提供帮助。

代码如下:

BottomNavigationBar(
        currentIndex: selectedIndex,
        unselectedItemColor: Colors.white,
        backgroundColor: Colors.black12,
        selectedItemColor: ASAP.info,
        showSelectedLabels: false,
        showUnselectedLabels: false,
        type: BottomNavigationBarType.fixed,
        onTap: (int i) {
          if (i == 2) {
            showSearch(context: context, delegate: SalonSearch());
            return;
          }

          setState(() {
            selectedIndex = i;
          });
        },
        iconSize: 30,
        items: [
          BottomNavigationBarItem(
            icon: const Icon(MdiIcons.mapMarkerRadiusOutline),
            title: Text(
              "Locations",
              style: TextStyle(color: Colors.red, decorationColor: Colors.red),
            ),
          ),
          BottomNavigationBarItem(
            icon: const Icon(MdiIcons.heartOutline),
            title: Text("Favourites"),
          ),
          BottomNavigationBarItem(
            icon: const Icon(
              MdiIcons.magnify,
            ),
            title: Text("Search"),
          ),
        ],
      )

问候 卡尔文

【问题讨论】:

标签: flutter dart navigation glow darkmode


【解决方案1】:

BottomNavigationBarelevation 设置为0 以消除该效果:

BottomNavigationBar(
        currentIndex: selectedIndex,
        unselectedItemColor: Colors.white,
        backgroundColor: Colors.black12,
        selectedItemColor: ASAP.info,
        showSelectedLabels: false,
        showUnselectedLabels: false,
        type: BottomNavigationBarType.fixed,
        elevation: 0,
...

【讨论】:

    猜你喜欢
    • 2022-01-06
    • 1970-01-01
    • 1970-01-01
    • 2019-12-23
    • 1970-01-01
    • 1970-01-01
    • 2022-11-18
    • 2020-07-29
    • 1970-01-01
    相关资源
    最近更新 更多