BottomNavigationBar 自定义 底部导航条、以及实现页面切换
2024-10-21 13:39:26
一、Flutter BottomNavigationBar 组件
BottomNavigationBar 是底部导航条,可以让我们定义底部 Tab 切换,bottomNavigationBar是 Scaffold 组件的参数。
BottomNavigationBar 常见的属性
属性名 | 说明 |
items | List<BottomNavigationBarItem> 底部导航条按钮集合 |
iconSize | icon |
currentIndex | 默认选中第几个 |
onTap | 选中变化回调函数 |
fixedColor | 选中的颜色 |
type |
BottomNavigationBarType.fixed BottomNavigationBarType.shifting |
Scaffold(
appBar: AppBar(
title: Text('Flutter Demo')
),
body: this._pagesList[this._curentIndex],
bottomNavigationBar: BottomNavigationBar(
currentIndex: _curentIndex,
onTap: _changePage,
fixedColor: Colors.black,
type: BottomNavigationBarType.fixed,
items: [
BottomNavigationBarItem(
title:Text("首页"),
icon:Icon(Icons.home)
),
BottomNavigationBarItem(
title:Text("分类"),
icon:Icon(Icons.category)
),
BottomNavigationBarItem(
title:Text("设置"),
icon:Icon(Icons.settings)
),
], ),
)
最新文章
- PlayMaker的应用
- 分表的一个记录---Ruby
- FZU 2129 子序列个数 (递推dp)
- Codeforces Gym 100637A A. Nano alarm-clocks 前缀和
- MinGW-notepad++开发c/c++程序
- Visual Studio 内置快速生产代码简写集合
- BZOJ 3563 DZY Loves Chinese
- Coco2d-x android win7 Python 游戏开发环境的搭建
- 数据库 MYSQL操作(一)
- 字符串匹配KMP算法的讲解C++
- linux环境中通过/dev/urandom设备产生随机密码
- 函数(一.return)
- ArcSDE账户频繁被锁定(Oracle显示12560协议适配器错误)
- Cglib源码分析 invoke和invokeSuper的差别(转)
- linux下tar gz bz2 tgz z等众多压缩文件的压缩与解压方法
- Monitoring an IBM JVM with VisualVM
- Npoi导出excel整理(附源码)
- Win7 系统还原
- bzoj 2055: 80人环游世界 -- 上下界网络流
- 【spring cloud】spring cloud 使用feign调用,1.fallback熔断器不起作用,2.启动报错Caused by: java.lang.ClassNotFoundException: com.netflix.hystrix.contrib.javanica.aop.aspectj.Hystri解决