小程序的导航栏样式在app.json中定义。json
这里设置导航,背景黑色,文字白色,文字内容测试小程序小程序
app.json内容:数组
{ "pages":[ "pages/index/index", "pages/login/login", "pages/logs/logs" ], "window":{ "backgroundTextStyle":"red", "navigationBarBackgroundColor": "#000", "navigationBarTitleText": "测试小程序", "navigationBarTextStyle":"#fff" } }
window中的样式说明:app
效果:测试
tabBar挺好的,能够放置于顶部或者底部,用于不一样功能页面的切换。spa
tabBar一样在app.json中进行定义,看一下我在app.json中对tabBar的相关定义:code
"tabBar": { "selectedColor": "#1296db", "list": [{ "pagePath": "pages/index/index", "text": "首页", "iconPath": "images/ico-home.png", "selectedIconPath": "images/ico-home-d.png" },{ "pagePath": "pages/setting/setting", "text": "设置", "iconPath": "images/ico-setting.png", "selectedIconPath": "images/ico-setting-d.png" },{ "pagePath": "pages/help/help", "text": "帮助", "iconPath": "images/ico-help.png", "selectedIconPath": "images/ico-help-d.png" }] }
效果:排序
tabBar相关属性定义说明:ip
tabBar list定义说明:it
tabBar 是一个数组,只能配置最少2个、最多5个 tab,tab 按数组的顺序排序。