跳至主要內容

全局配置 window

刘春龙原创...小于 1 分钟WEB前端小程序教程文档

window 用于设置小程序的状态栏、导航条、标题、窗口背景色等等

常用属性

属性类型默认值描述
navigationBarBackgroundColorHexColor#000000导航栏背景颜色,如 #000000
navigationBarTextStylestringwhite导航栏标题颜色,仅支持 black / white
navigationBarTitleTextstring导航栏标题文字内容
backgroundColorHexColor#ffffff窗口的背景色
backgroundTextStylestringdark下拉 loading 的样式,仅支持 dark / light
enablePullDownRefreshbooleanfalse是否开启全局的下拉刷新。
onReachBottomDistancenumber50页面上拉触底事件触发时距页面底部距离,单位为 px。

修改 app.json 文件中的 window 属性配置

"window": {
  "navigationBarBackgroundColor": "#000000",
  "navigationBarTextStyle": "white",
  "navigationBarTitleText": "第一个小程序",
  "backgroundColor": "#000000",
  "backgroundTextStyle": "light",
  "enablePullDownRefresh":true,
  "onReachBottomDistance":50
},
上次编辑于:
贡献者: 刘春龙
评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v2.15.7