微信动态模糊样式,微信红包两种导航栏样式切换,颜色过渡切换,导航栏背景图片切换,导航栏透明度切换,有无导航栏切换.
OC 版 VHLNavigation
参考学习
手动拖入 将 VHLNavigation
文件夹拽入项目中
或者通过 pod 导入 pod 'VHLNavigation_Swift'
导入头文件:#import "VHLNavigation.h"
用法和 VHLNavigation
OC 版一致
设置导航栏背景图片
self.vhl_navBarBackgroundImage = UIImage(named: "navbg")
设置导航栏背景颜色
self.vhl_navBarBackgroundColor = getRandomColor()
设置导航栏透明度
self.vhl_navBarBackgroundAlpha = CGFloat(arc4random()) / CGFloat(UInt32.max)
设置导航栏标题颜色
self.vhl_navBarTitleColor = getRandomColor()
设置导航栏按钮颜色
self.vhl_navBarTintColor = getRandomColor()
设置是否隐藏分割线
self.vhl_navBarShadowImageHide = false
隐藏导航栏
self.vhl_navBarHide = true
self.vhl_navSwitchStyle = .fakeNavBar
let blurBGColor = UIColor(red:0.93, green:0.93, blue:0.93, alpha:0.9)
let blurEffect = UIBlurEffect(style: .light)
let bgView = UIVisualEffectView(effect: blurEffect)
bgView.backgroundColor = blurBGColor
// ** 给自定义的 View 标记tag, 如果两个 vc 的自定义view tag一样,那么不会以假导航栏样式过渡
bgView.tag = 788 //Int(arc4random())
self.vhl_navBarBackgroundView = bgView
- blog: https://www.vincents.cn
- email: gvincent@163.com
- qq: 2801818138