如何设置Flutter iPhone X安全区域

问题描述 投票:-1回答:1

我在这个项目中使用Flutter的原因是将Android和iphone放在一个代码库中。 Android应用程序看起来不错,底部导航栏击中屏幕主页。

然而iphone版本会进入iphone X机型的滑动条。

有办法解决这个问题吗?我可以调整它,但我不想要一个投影,我只想要一个纯色。

我使用了SafeArea,虽然它确实修复了它。它也导致酒吧向上移动,看起来很奇怪。

bottomNavigationBar: SafeArea(
     child: bmnav.BottomNav(
      elevation: 9.0,
      index: _currentTab,
      iconStyle: bmnav.IconStyle(
          color: Colors.grey, onSelectColor: Colors.lightGreen),
      labelStyle: bmnav.LabelStyle(
          onSelectTextStyle: TextStyle(color: Colors.lightGreen)),
      onTap: (int index) {
        setState(() {
          _currentTab = index;
        });
      },
      items: [
        bmnav.BottomNavItem(Customicons.main, label: "Home"),
        bmnav.BottomNavItem(Customicons.bible, label: "Bible"),
        bmnav.BottomNavItem(Customicons.sermons, label: "Sermons"),
        bmnav.BottomNavItem(FontAwesomeIcons.pray, label: "Prayer"),
        bmnav.BottomNavItem(Icons.more_horiz, label: "More"),
      ]),
),

无论有没有安全区域,这都是它的样子。但我正在寻找的是一个售卖的外观,基本上就像一个大型底部导航栏。

enter image description hereenter image description here

dart flutter
1个回答
1
投票
return SafeArea(
  bottom: true,
  child: bmnav.BottomNav(),
)
© www.soinside.com 2019 - 2024. All rights reserved.