setTimeout(() => {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: this.topBackgroundColor,
animation: {
duration: 80,
timingFunc: 'easeIn'
}
})
}, 200)

- 发布:2022-05-07 08:48
- 更新:2022-05-07 09:19
- 阅读:328
产品分类: uniapp/H5
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 11.5.2
HBuilderX类型: 正式
HBuilderX版本号: 3.4.7
浏览器平台: Chrome
浏览器版本: 100.0.4896.127
项目创建方式: HBuilderX
示例代码:
操作步骤:
根据接口返回的背景色,在onShow() {
setTimeout(() => {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: this.topBackgroundColor,
animation: {
duration: 80,
timingFunc: 'easeIn'
}
})
}, 200)
},
根据接口返回的背景色,在onShow() {
setTimeout(() => {
uni.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: this.topBackgroundColor,
animation: {
duration: 80,
timingFunc: 'easeIn'
}
})
}, 200)
},
预期结果:
H5导航栏返回箭头垂直居中
H5导航栏返回箭头垂直居中
实际结果:
没有垂直居中
没有垂直居中
bug描述:
单纯根据接口返回的背景色,动态设置背景色,H5返回箭头不是垂直居中,偏上