uniapp,pages.json文件中globalStyle
pages.json 文件用来对 uni-app 进行全局配置,决定页面文件的路径、窗口样式、原生的导航栏、底部的原生tabbar 等。
globalStyle
用于设置应用的状态栏、导航条、标题、窗口背景色等
{
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index"
}
],
"globalStyle": {
"autoscan": true,// //是否自动扫描组件
"navigationBarTextStyle": "black",//导航栏标题颜色及状态栏前景颜色,仅支持 black/white
"navigationBarTitleText": "商城",//导航栏标题文字内容
"navigationBarBackgroundColor": "#ffffff",//导航栏背景颜色(同状态栏背景色)
"backgroundColor": "#ffffff",//下拉显示出来的窗口的背景色
"onReachBottomDistance": 150//页面上拉触底事件触发时距页面底部距离,单位只支持px
},
}
具体官方文档https://uniapp.dcloud.io/collocation/pages.html#globalstyle