我用的是Taro多端编译写的小程序,原生的换成wx.setNavigationBarColor即可
Taro.setNavigationBarColor({ frontColor: '#ffffff', backgroundColor: '#1c2060', animation: { duration: 1 } })