首先我们先去json文件中定义:
1.下拉刷新enablePullDownRefresh的支持
app.json配置(所有页面都带有下拉刷新功能)
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
2、设置backgroundTextStyle 大家会发现别人的小程序下拉刷新是有三个点闪烁的动画、自己设置的并没有。这里面有个设置backgroundTextStyle的支持:
"backgroundTextStyle": "",支持 dark/light
3、动态设置下拉背景字体、loading 图的样式
wx.setBackgroundTextStyle({
textStyle: 'dark' // 下拉背景字体、loading 图的样式为dark
})
4、动态设置窗口的背景色
wx.setBackgroundColor({
backgroundColor: '#ffffff', // 窗口的背景色为白色})
<!--兼容ios-->
wx.setBackgroundColor({
backgroundColorTop: '#DC143C', // 顶部窗口的背景色为红
backgroundColorBottom: '#00FA9A', // 底部窗口的背景色为绿
})