tabBar无法显示?
发布于 7 年前 作者 xiangming 14674 次浏览 来自 官方Issues

  “tabBar”: {

    “position”:“bottom”,

    “list”: [{

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

      “text”: “left”,

      “iconPath”: “assets/images/icons/arrow_left.png”,

      “selectedIconPath”: “assets/images/icons/page_first.png”

    },{

      “pagePath”: “pages/home/home”,

      “text”: “right”,

      “iconPath”: “assets/images/icons/arrow_right.png”,

      “selectedIconPath”: “assets/images/icons/page_last.png”

    }]

设置如上,对应路径都有相应的icon图片,但是tabBar不显示

9 回复

麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

你怎么解决的啊,我也遇到这问题了

没有任何报错信息???

图片地址前面加个/看看,是不是路径问题

我猜 你的首页并不是logs页面,而是其他页面

我猜不到

{
  "pages": [
    "pages/index/index",
    "pages/course/course",
    "pages/weibo/weibo",
    "pages/logs/logs",
    "images/tabber"
  ],
  "window": {
    "backgroundTextStyle": "dark",
    "navigationBarBackgroundColor": "#ccc",
    "navigationBarTextStyle": "black",
    "navigationStyle": "default",
    "navigationBarTitleText": "微信接口功能演示",
    "backgroundColor": "pink",
    "enablePullDownRefresh": true
  },
  "tabBar": {
    "color": "#8a8a8a",
    "selectedColor": "#1AAD16",
    "list": [
      {
        "pagepath":"pages/index/index",
        "text": "微信",
        "iconpath": "images/tabbar/tabbar.png",
        "selectedIconpath": "images/tabbar/tabbar1selected.png"
      },
      {
        "pagePath": "pages/course/course",
        "text": "通讯录",
        "iconpath": "images/tabbar/通讯录.png",
        "selectedIconpath": "images/tabbar/通讯录selected.png"
      },
      {
        "pagePath": "pages/weibo/weibo",
        "text": "发现",
        "iconpath": "images/tabbar/发现.png",
        "selectedIconpath": "images/tabbar/发现selected.pn"
      },
      {
        "pagePath": "pages/logs/logs",
        "text": "我",
        "iconpath": "images/tabbar/我.png",
        "selectedIconpath": "images/tabbar/我selected.png"
      }
    ]
  },
  "sitemapLocation": "sitemap.json"

}




错误信息:VM248:1 appJSON["tabBar"]["list"][0]["pagePath"] 字段需为 string


自己研究了半天没找到bug 谢谢

这个问题就是在与当前页面在tabBar中没有进行配置

{
  "pages": [
    "pages/home/home",
    "pages/about/about",
    "pages/profile/profile",
    "pages/category/category"
  ],
  "window": {
    "backgroundTextStyle""light",
    "navigationBarBackgroundColor""#ff5777",
    "navigationBarTitleText""Study Demo",
    "navigationBarTextStyle""white",
    "backgroundColor""#fffeee"
  },
  "tabBar": {
    "color""red",
    "selectedColor""blue",
    "backgroundColor""#fffeee",
    "list": [
      {
        "pagePath""pages/home/home",
        "text""首页",
        "iconPath""assets/images/icon/index.png",
        "selectedIconPath""assets/images/icon/index2.png"
      },
      {
        "pagePath""pages/profile/profile",
        "text""text",
        "iconPath""assets/images/icon/index.png",
        "selectedIconPath""assets/images/icon/index2.png"
      },
      {
        "pagePath""pages/category/category",
        "text""分类",
        "iconPath""assets/images/icon/index.png",
        "selectedIconPath""assets/images/icon/index2.png"
      },
      {
        "pagePath""pages/about/about",
        "text""关于我们",
        "iconPath""assets/images/icon/index.png",
        "selectedIconPath""assets/images/icon/index2.png"
      }
    ]
  },
  "networkTimeout": {
    "request"10000,
    "downloadFile"10000
  },
  "debug"true,
  "navigateToMiniProgramAppIdList": ["wxe5f52902cf4de896"],
  "style""v2",
  "sitemapLocation""sitemap.json"
}

{

 “pages”: [

    “pages/login/login”,

    “pages/home/home”,

    “pages/logs/logs”,

    “pages/about/about”

  ],

  “window”: {

    “backgroundTextStyle”: “light”,

    “navigationBarBackgroundColor”: “#ff5777”,

    “navigationBarTitleText”: “WeChat”,

    “navigationBarTextStyle”: “black”,

    “enablePullDownRefresh”: false

  },

  “tabBar”: {

    “position”:“bottom”,

    “list”: [{

      “pagePath”: “pages/login/login”,

      “text”: “left”,

      “iconPath”: “assets/images/icons/arrow_left.png”,

      “selectedIconPath”: “assets/images/icons/page_first.png”

    },{

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

      “text”: “right”,

      “iconPath”: “assets/images/icons/arrow_right.png”,

      “selectedIconPath”: “assets/images/icons/page_last.png”

    }]

  },

  “sitemapLocation”: “sitemap.json”

}

回到顶部