網(wǎng)站首頁 編程語言 正文
微信小程序--動態(tài)設(shè)置導(dǎo)航欄顏色
既然要動態(tài)設(shè)置導(dǎo)航欄顏色,估計 自定義導(dǎo)航欄 也跑不了
關(guān)于動態(tài)設(shè)置導(dǎo)航欄顏色,微信小程序官方文檔給出了一個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('設(shè)置成功')
},
fail: () => {
console.log('設(shè)置失敗')
},
complete: () => {
console.log('設(shè)置結(jié)束')
},
})
需要注意的是:
- frontColor只有兩個選擇:
#ffffff
和#000000
-
frontColor
、backgroundColor
兩個都需要設(shè)置
原文鏈接:https://blog.csdn.net/Dark_programmer/article/details/125895873
相關(guān)推薦
- 2023-02-10 Pytorch模型微調(diào)fine-tune詳解_python
- 2022-11-22 Kotlin?by關(guān)鍵字作用及使用介紹_Android
- 2023-10-25 解決使用window.open()或window.location.href跳轉(zhuǎn)后返回/后退原頁面不
- 2022-07-28 超級詳細(xì)講解C++中的多態(tài)_C 語言
- 2022-08-04 十分鐘教會你用Python處理CSV文件_python
- 2022-10-28 關(guān)于react中的常見錯誤及解決_React
- 2023-06-17 C#?輸出參數(shù)out問題_C#教程
- 2023-10-09 Cookie和localStorage存儲的區(qū)別
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支