微信小程序tabBar显示问题

在微信小程序的开发中,我遇到疑惑如下:

在app.json中定义了多个pages,一般微信小程序启动的时候,自动加载pages下的第一个页面,

"pages": [
      
   
     "pages/index/index",
     
      "pages/main/main",
      "pages/you/you",
      "pages/me/me"
  ],


"tabBar": {
    "color": "#929292",
    "selectedColor": "#ff2d55",
    "borderStyle": "white",
    "backgroundColor": "#ffffff",
    "list": [{
      "pagePath": "pages/me/me",
      "iconPath": "image/tabbar/1.png",
      "selectedIconPath": "image/tabbar/1-hl.png", 
      "text": "我的demo"                      
    }, {
      "pagePath": "pages/you/you",
      "iconPath": "image/tabbar/2.png",
      "selectedIconPath": "image/tabbar/2-hl.png",
      "text": "demo1"
    }

如果将index 或者main放在第一行,tabBar并不显示出来,但是you 和me 页面放在第一行的时候,是可以显示的,后来查到是因为只有当放在第一行的页面是在tabBar的list的某一个页面才可以显示,也就是说you 和me页面是在tabBar的list下面,所以可以显示,而另外的2个不能显示

猜你喜欢

转载自blog.csdn.net/u013401913/article/details/52926691