2_tabbar底部切换

Tabbar使用

1. 在app.json中配置

核心代码

 
  1. "tabBar": {
  2. "selectedColor": "#1296db",
  3. "list": [
  4. {
  5. "pagePath": "pages/home/home",
  6. "text": "首页",
  7. "iconPath": "images/mainTab/tab1.png",
  8. "selectedIconPath": "images/mainTab/tab1.png"
  9. },
  10. {
  11. "pagePath": "pages/test/test",
  12. "text": "好玩",
  13. "iconPath": "images/mainTab/tab3.png",
  14. "selectedIconPath": "images/mainTab/tab3.png"
  15. }
  16. ]
  17. }

2. 使用

 
  1. 经过app.json中的配置,在这以后,须要经过switchTab进行跳转【含有tabbar只能经过switchTab跳转】

相关文章
相关标签/搜索