微信小程序app.json配置

找到app.json文件,找到window配置项

1.windows选项下导航栏样式

"navigationBarBackgroundColor":#F6F6F6 // 导航栏的背景颜色
"navigationBarTextStyle":"white" // 导航栏的标题颜色,只支持balck 或者 white
"navigationBarTitleText":"导航栏标题内容"   // 导航栏的标题
"navigationStyle":"custom"  // 导航栏的样式,只能default 或者 custom, 如果设置为custom,那么就会去掉默认导航栏

2.窗口的颜色。窗口指的是小程序页面上拉或者下拉的背景颜色,可以在真机上调试。

"backgroundColor":"#000"    // app.json配置文件中的所有颜色值都只能写色标不能使用颜色单词,除navigationBarTextStyle的这个选项外。

设置上滑时和下拉时的背景颜色[只在ios上上生效]:

"backgroundColorTop":"#333",
"backgroundColorBottom":"#999"

在真机上查看效果:

点击编辑器上的预览按钮,扫描生成的二维码,就可以在手机上打开小程序。

3.开启下拉刷新,在电脑也能下拉:

"enablePullDownRefresh":true

也可以在其他页面的json文件中使用"navigationBarTitleText",配置页面的标题。

原文地址:https://www.cnblogs.com/luguankun/p/10350012.html