小程序窗口底部的TabBar

1.在app.json中加一个名为"tabBar"的属性,这个属性是一个数组,只能配置最少两个最多五个tab,每个tab可配置显示的文字和图标。

"tabBar":{

                "color":"#000",                                                       tab未激活状态时文字的颜色

                "selectedColor":"#fff",                                            tab激活状态时文字的颜色

                "borderStyle":"#ddd",                                                    tabBar边框的颜色

                "list":[{

                            "pagePath":"page/logs/logs",

                            "iconPath":"images/00.png",

                            "selectedIconPath":"images/01.png",

                            "text":"个人中心"

                            },{

                                "pagePath":"page/loading/loading",

                                "iconPath":"images/02.png",

                                "selectedIconPath":"images/03.png",

                                 "text":"主页"

                               }]   

},                                       

 list是一个数组,用来设置每一个tab的显示样式

                                            pagePath用来设置点击tab时的跳转路径

                                            iconPath设置tab未激活时图标的路径

                                            selectedIconPath设置tab激活时的图片路径

                                            text设置tab上显示的文字





需要把app.json的"page"数组下的第一个路径设置为tab里面的跳转路径之一


你可能感兴趣的:(小程序窗口底部的TabBar)