如这样的代码,是不会在底部显示tabBar的。
{
"pages": [
"pages/search/search",
"pages/detail/detail",
"pages/my/my"
],
"tabBar": {
"list": [
{
"iconPath": "assets/img/search-1.png",
"selectedIconPath": "assets/img/search.png",
"pagePath": "pages/nearby/nearby",
"text": "搜索"
},
{
"iconPath": "assets/img/icon_normal.png",
"selectedIconPath": "assets/img/icon_pressed.png",
"pagePath": "pages/my/my",
"text": "我的"
}
]
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#42BD56",
"navigationBarTitleText": "iReading",
"navigationBarTextStyle": "white"
}
}
理由是:
pages中的第一个页面,没有出现在tabBar配置项中。
所以至少需要在tabBar中。
那么改成如下的代码即可。
{
"pages": [
"pages/search/search",
"pages/detail/detail",
"pages/my/my"
],
"tabBar": {
"list": [
{
"iconPath": "assets/img/search-1.png",
"selectedIconPath": "assets/img/search.png",
"pagePath": "pages/nearby/nearby",
"text": "搜索"
},
{
"iconPath": "assets/img/search-1.png",
"selectedIconPath": "assets/img/search.png",
"pagePath": "pages/search/search",
"text": "搜索"
},
{
"iconPath": "assets/img/icon_normal.png",
"selectedIconPath": "assets/img/icon_pressed.png",
"pagePath": "pages/my/my",
"text": "我的"
}
]
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#42BD56",
"navigationBarTitleText": "iReading",
"navigationBarTextStyle": "white"
}
}