当我在iOS上运行Ffltter应用程序时,我的底部导航格式错误.它似乎在漂浮:
我的脚手架是这样的:
Scaffold(
appBar: getAppbar(),
drawer: getMainDrawer(context),
floatingActionButton: ...,
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
body: SafeArea(
top: false,
bottom: false,
child: _widgetOptions.elementAt(_selectedIndex),
),
extendBody: true,
bottomNavigationBar: buildBottomNavigationBar())
我的底部导航如下所示:
Widget buildBottomNavigationBar() {
return BottomAppBar(
key: const Key('bottomAppBar'),
shape: const CircularNotchedRectangle(),
elevation: 4,
notchMargin: 8,
clipBehavior: Clip.antiAlias,
child: BottomNavigationBar(
showUnselectedLabels: false,
showSelectedLabels: false,
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: FaIcon(FontAwesomeIcons.dumbbell),
label: 'Sets',
),
BottomNavigationBarItem(
icon: FaIcon(FontAwesomeIcons.calendar),
label: 'Timeline',
),
],
currentIndex: _selectedIndex,
onTap: _onItemTapped,
),
);
}
请注意,底部导航在Android上看起来很好.有人知道iOS上出现这种情况的原因吗?