BottomNavigationBar
作者:互联网
下面是bottomnavigationbar的具体用法:
bottomNavigationBar: BottomNavigationBar(
currentIndex: highlight,//选择高亮显示的Tab选项,每个Tab都有编号的,从0开始编号;
onTap: (int index){
setState(() {
highlight=index;//这里的index就是下面导航按钮的编号,每个Tab都有编号的,从0开始
});
},
items: [
BottomNavigationBarItem(icon: Icon(Icons.airplay),title: Text('AirPlay'),backgroundColor: Colors.orange),//编号0
BottomNavigationBarItem(icon: Icon(Icons.directions_bike),title: Text('directions_bike'),backgroundColor: Colors.orange),//编号2
BottomNavigationBarItem(icon: Icon(Icons.add_a_photo),title: Text('add_a_photo'),backgroundColor: Colors.orange),//编号2
BottomNavigationBarItem(icon: Icon(Icons.email),title: Text('email'),backgroundColor: Colors.orange),//编号3
],
),
标签:title,Text,Icons,backgroundColor,编号,orange,BottomNavigationBar 来源: https://www.cnblogs.com/braveheart007/p/10727451.html