RainbowNavigation 中文介绍
You can use RainbowNavigation
to set the backgroundColor of UINavigationBar
in animation.
- Set the backgroundColor of
UINavigationBar
. - Make transparent
UINavigationBar
- Add statusBar mask for
UINavigationBar
- Update the backgroundColor of
UINavgationBar
in animation - Support
Push/Pop
operations - Support gesture
Pop
operation
- iOS 8.0 +
- Swift 2.0 +
add following code to your Podfile
pod 'RainbowNavigation'
Make UINavigationBar
transparent
navigationBar.ll_setBackgroundColor(UIColor.clearColor())
Restore the default values
navigationBar.ll_reset() // 恢复默认,取消之前的颜色设置的影响
navigationBar.ll_setStatusBarMaskColor(UIColor.blackColor().colorWithAlphaComponent(0.1))
wire the UINavigationController
to RainbowNavigation
lazy var rainbowNavigation = LLRainbowNavigation()
override func viewDidLoad() {
super.viewDidLoad()
if let navController = self.navigationController {
rainbowNavigation.wireTo(navigationController: navController)
}
}
UINavigationController's
children viewControllers comfirm LLRainbowColorSource
protocol, and return the UINavigationBar
color is OK.
@objc public protocol LLRainbowColorSource {
optional func ll_navigationBarInColor() -> UIColor
optional func ll_navigationBarOutColor() -> UIColor
}
RainbowNavigation
is simple to use, downlaod the demo project and learn more.
DanisFabric, [email protected]
RainbowNavigation is available under the MIT license. See the LICENSE file for more info.