编程那点事 编程那点事编程那点事

百度小程序tabBar不显示

百度小程序tabBar不显示

tabBar,即底部标签栏。

百度小程序tabBar

按照官方文档,在app.json中增加了如下代码

"tabBar": {
        "color": "#a2a2a2",
        "selectedColor": "#3388ff",
        "borderStyle": "black",
        "backgroundColor": "#ffffff",
        "list": [{
            "pagePath": "pages/detail/detail",
            "iconPath": "images/component_normal.png",
            "selectedIconPath": "images/component_selected.png",
            "text": "首页"
        },{
            "pagePath": "pages/index/index",
            "iconPath": "images/API_normal.png",
            "selectedIconPath": "images/API_selected.png",
            "text": "列表"
        }]
    }

但是,编译百度小程序后确看不到底部标签栏,后来找了愿意,是因为list中的pagePath在,app.json中未定义,

app.json pages值

所以把pagePath里的值改成pages里有的,在编译百度小程序就能显示tabBar了。

编程那点事 更专业 更方便

登录

找回密码

注册