微信小程序设置导航栏颜色设置navigationBarBackgroundColor属性微信小程序官方文档提供了APIwx.setNavigationBarColor代码示例wx.setNavigationBarColor({frontColor:'#ffffff',backgroundColor:'#ffffff',animation:{duration:400,timingFunc:'easeIn'},success:()=>{console.log('导航栏背景颜色设置成功')},fail:()=>{console.log('导航栏背景颜色设置失败')},complete:()=>{co
大体思路:第一步:“navigationStyle”:“custom”第二步:template内重点:给view添加ref=“top”第三步:添加渐变色样式1、pages.json{"path":"pages/user/user","style":{"navigationBarTitleText":"我的", "navigationBarTextStyle":"black",//标题栏字体颜色 "navigationBarBackgroundColor":"#1890FF",//标题栏背景色(纯色) "navigationStyle":"custom"//用户自定义(添加此处!!!!!)