赞
踩
运行如下的命令,基于 master 分支在本地创建 tabBar 子分支,用来开发和 tabBar 相关的功能:
git checkout -b tabbar
在 pages 目录中,创建首页(home)、分类(cate)、购物车(cart)、我的(my) 这 4 个 tabBar 页面。在 HBuilderX 中,可以通过如下的两个步骤,快速新建页面
- "tabBar": {
- "selectedColor": "#C00000",
- "list": [
- {
- "pagePath": "pages/home/home",
- "text": "首页",
- "iconPath": "static/tab_icons/home.png",
- "selectedIconPath": "static/tab_icons/home-active.png"
- },
- {
- "pagePath": "pages/cate/cate",
- "text": "分类",
- "iconPath": "static/tab_icons/cate.png",
- "selectedIconPath": "static/tab_icons/cate-active.png"
- },
- {
- "pagePath": "pages/cart/cart",
- "text": "购物车",
- "iconPath": "static/tab_icons/cart.png",
- "selectedIconPath": "static/tab_icons/cart-active.png"
- },
- {
- "pagePath": "pages/my/my",
- "text": "我的",
- "iconPath": "static/tab_icons/my.png",
- "selectedIconPath": "static/tab_icons/my-active.png"
- }
- ]
- }
- {
- "globalStyle": {
- "navigationBarTextStyle": "white",
- "navigationBarTitleText": "冲刺练习",
- "navigationBarBackgroundColor": "#C00000",
- "backgroundColor": "#FFFFFF"
- }
- }
git add .
git commit -m " 完成了 tabBar 的开发 "
git push -u origin tabbar
git checkout mastergit merge tabbar
git branch -d tabbar
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。