KxSwiftNavigation
翻譯自 HBDNavigationBar(Objective-C語言)
支持Swift5.0+
導(dǎo)航欄的平滑過渡,可以劃分為以下情況
我們來看微信是如何平滑切換導(dǎo)航欄的狀態(tài)的

weixin
陰影顯示與隱藏

shadow
導(dǎo)航欄有與無

hidden
導(dǎo)航欄背景透明度隨 UIScrollView 滾動變化

gradient
控制器擁有不同的導(dǎo)航欄背景

background
透明度

alpha.gif
安裝:
pod 'KxSwiftNavigation'
使用方法如下,采用前綴navigation.xxx的方式設(shè)置相關(guān)屬性,參考Demo
navigation.barStyle = .black
navigation.barTintColor = .random
navigation.tintColor = .white
navigation.titleTextAttributes = [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 17),
NSAttributedString.Key.foregroundColor: UIColor.white]