網站首頁 編程語言 正文
微信小程序--動態設置導航欄顏色
既然要動態設置導航欄顏色,估計 自定義導航欄 也跑不了
關于動態設置導航欄顏色,微信小程序官方文檔給出了一個API: wx.setNavigationBarColor
官方給出的示例:
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
animation: {
duration: 400,
timingFunc: 'easeIn'
}
})
我的實際使用:
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ffffff',
animation: {
duration: 400,
timingFunc: 'easeIn'
},
success: () => {
console.log('設置成功')
},
fail: () => {
console.log('設置失敗')
},
complete: () => {
console.log('設置結束')
},
})
需要注意的是:
- frontColor只有兩個選擇:
#ffffff
和#000000
-
frontColor
、backgroundColor
兩個都需要設置
原文鏈接:https://blog.csdn.net/Dark_programmer/article/details/125895873
相關推薦
- 2023-05-23 Python中對數據庫的操作詳解_python
- 2023-02-18 Go?gin權限驗證實現過程詳解_Golang
- 2023-01-29 Redis配置外網可訪問(redis遠程連接不上)的方法_Redis
- 2022-05-15 jquery事件綁定方法介紹_jquery
- 2022-07-27 python?iloc和loc切片的實現_python
- 2022-07-30 Redis如何使用HyperLogLog的實現_Redis
- 2022-03-23 C++實現水仙花數判斷實例_C 語言
- 2022-10-15 Go?Excelize?API源碼閱讀GetPageLayout及SetPageMargins_Go
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支