3.0 tabBar
- 概念
- 移动端页面的导航栏
- 步骤:
- 1.0 创建四个 tab 页面
- 2.0 将这四个页面配置为 tab
- 在 app.json 中的 tabBar 下进行配置
- color: 文本默认颜色
- selectedColor: 文本选中颜色
- backgroundColor: tab 栏的背景色
- border: 边框
- postion: tab 所在的位置
- list: tab 栏的 tab 选项 数组
- 对象
- pagePath: tab 选项的路径
- text: tab 选项中的文本
- iconPath: 图片的路径
- selectedIconPath:选中图片的路径
- 对象
- 在 app.json 中的 tabBar 下进行配置
- 特点:
- 1)只有配置在 tabBar 中的页面才有 tab 栏
- 2)从 非 tab 页面跳转到 tab 页面
- 不能使用 navigateTo
- 应该使用 switchTab