微信小程序设置页面导航条颜色可以使用官方提供的wx.setNavigationBarColor API,需要页面权限,当前是插件页面时,宿主小程序不能调用该接口,反之亦然。
示例代码:
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})
相关参数可参考微信官方文档:https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.setNavigationBarColor.html
暂无评论,抢个沙发...