微信小程序的background背景窗口配置是在app.json中实现的。在官方文档的框架/全局配置:
![8442a4c488bbfe2ad1d38ba2d973d31d.png](https://i-blog.csdnimg.cn/blog_migrate/21fed4186296f6ffab14149949eeb3a1.jpeg)
其中backgroundColor下面的参数都是背景窗口配置:
![b3fec54584efa255e51e990c83aeea70.png](https://i-blog.csdnimg.cn/blog_migrate/07fee5d30bd21b8908f511bd56a389ef.jpeg)
那什么是小程序的background背景窗口呢?看官方效果图,红圈标示background的地方就是:
![b4ce8b0e44284192cd07042aaf94cb42.png](https://i-blog.csdnimg.cn/blog_migrate/ed029305d89ed0fc3cedf5bab2f8f4f7.jpeg)
在真机里下拉时候出现的空白处就是background。如果要看的明显,我们可以把backgroundColor设置为蓝色,如图蓝色部分即为background窗口(注意要下拉小程序时候才会出现):
![e8625522a8aeda396f0e99e259fdf407.png](https://i-blog.csdnimg.cn/blog_migrate/900e6df18228e2a79d6145da2b61e923.jpeg)
要想在开发者工具中看到效果,需要配置"enablePullDownRefresh": true。
也就是在app.json中这样配置:
"window": {
"enablePullDownRefresh": true,
"backgroundColor": "#0000FF"
}
以上background窗口介绍完,大家可以关注小程序-你选我选,效果尽显:
![c0c25efd3a4937b8aca4b7a19ecd0ec1.png](https://i-blog.csdnimg.cn/blog_migrate/69cbaf28520f63a1f8867357f3fe879a.jpeg)