请问为何tabBar 不显示
发布于 6 年前 作者 juanlu 14953 次浏览 来自 官方Issues

tabBar不显示

应该显示tabBar的。app.json代码如下

{

“pages”: [

“pages/mypage/mypage”,

“pages/logs/logs”,

“pages/index/index”

],

“window”: {

“backgroundTextStyle”: “light”,

“navigationBarBackgroundColor”: “#fff”,

“navigationBarTitleText”: “WeChat”,

“navigationBarTextStyle”: “black”,

“enablePullDownRefresh”:true

},

“tabBar”: {

“color”: “#000”,

“selectedColor”: “#56abe4”,

“backgroundColor”: “#fff”,

“borderStyle”: “black”,

“list”: [

{

“pagePath”: “pages/mypage/mypage”,

“text”: “设置”,

“iconPath”: “icon/icon3.png”,

“SelectedIconPath”: “icon/icon3.png”

},

{

“pagePath”: “pages/logs/logs”,

“text”: “日志”,

“iconPath”: “icon/icon2.png”,

“SelectedIconPath”: “icon/icon2.png”

},

{

“pagePath”: “pages/index/index”,

“text”: “首页”,

“iconPath”:“icon/icon1.png”,

“SelectedIconPath”:“icon/icon1.png”

}

],

“custom”: true

},

“networkTimeout”:{

“request”:30000,

“connectSocket”:3000,

“uploadFile”:3000,

“downloadFile”:3000

},

“sitemapLocation”: “sitemap.json”,

“debug”:true  

}

5 回复

我找到了源代码,对比后发现,app.json中

"sitemapLocation""sitemap.json",

"debug":true  

应该改为

"debug":true  

"sitemapLocation""sitemap.json",

另外SelectedIconPath应该是selectedIconPath

非常感谢大家的热心解答,问题已经解决

我的不仅不显示,编译时直接提示tabBar那部分有问题。代码用的示例代码,应该不是代码问题。

自定义组件吗?还是原生的?这边测试没复现

看看是不是你json里面有错误的,

你开启隐藏tabbar了吗?

回到顶部