微信小程序中有很多可以在.json文件设置的属性,包括设置小程序的状态栏、导航条、标题、窗口背景色等,
window
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| navigationBarBackgroundColor | HexColor | 000000 | 导航栏背景颜色,如”#000000” |
| navigationBarTextStyle | String | white | 导航栏标题颜色,仅支持 black/white |
| navigationBarTitleText | String | 导航栏标题文字内容 | |
| navigationStyle | String | default | 导航栏样式,仅支持 default/custom。custom 模式可自定义导航栏,只保留右上角胶囊状的按钮 |
| backgroundColor | HexColor | ffffff | 窗口的背景色 |
| backgroundTextStyle | String | dark | 下拉 loading 的样式,仅支持 dark/light |
| backgroundColorTop | String | ffffff | 顶部窗口的背景色,仅 iOS 支持 |
| backgroundColorBottom | String | ffffff | 底部窗口的背景色,仅 iOS 支持 |
| enablePullDownRefresh | Boolean | false | 是否开启下拉刷新 |
| onReachBottomDistance | Number | 50 | 页面上拉触底事件触发时距页面底部距离,单位为px |
注:HexColor(十六进制颜色值),如”#ff00ff”
注:navigationStyle 只在 app.json 中生效。开启 custom 后,低版本客户端需要做好兼容
- {
- "navigationBarTitleText": "对战",
- "enablePullDownRefresh": false,
- "disableScroll": true,
- "usingComponents": {
- "dialog": "/components/dialog/index"
- }
- }
新闻热点
疑难解答