我只在使用库'package:flutter / cupertino.dart';制作应用程序...但是我不能放下CupertinoTabBar。有人能帮我吗? myapp here
CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text("Escala NVP"),
),
child: SafeArea(
child: Container(
child: CupertinoTabBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: Icon(IconData(0xF38F, fontFamily: "CupertinoIcons", fontPackage: CupertinoIcons.iconFontPackage)), title: Text("Início")),
BottomNavigationBarItem(icon: Icon(IconData(0xF2D1, fontFamily: "CupertinoIcons", fontPackage: CupertinoIcons.iconFontPackage)), title: Text("Calendário")),
BottomNavigationBarItem(icon: Icon(IconData(0xF3A0, fontFamily: "CupertinoIcons", fontPackage: CupertinoIcons.iconFontPackage)), title: Text("Perfil")),
],
currentIndex: _selectedIndex,
onTap: (int index){
setState(() {
_selectedIndex = index;
});
},
),
),
),
);
最佳答案
我知道了。
CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text("Escala NVP"),
),
child: CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(icon: Icon(IconData(0xF38F, fontFamily: "CupertinoIcons", fontPackage: CupertinoIcons.iconFontPackage)), title: Text("Início")),
BottomNavigationBarItem(icon: Icon(IconData(0xF2D1, fontFamily: "CupertinoIcons", fontPackage: CupertinoIcons.iconFontPackage)), title: Text("Calendário")),
BottomNavigationBarItem(icon: Icon(IconData(0xF3A0, fontFamily: "CupertinoIcons", fontPackage: CupertinoIcons.iconFontPackage)), title: Text("Perfil")),
],
currentIndex: _selectedIndex,
onTap: (int index){
setState(() {
_selectedIndex = index;
});
},
),
tabBuilder: (BuildContext context, int index){
return CupertinoTabView(
builder: (BuildContext context){
return Container(
);
},
);
},
),
);
关于ios - 放下CupertinoTabBar,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/63026057/