测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2016年10月 |
SPM支持SPM | ✗ |
Maintained by zhiquan911.
CHParallaxHeaderView 可以通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile
pod "CHParallaxHeaderView"
@IBOutlet var tableView: UITableView!
@IBOutlet var imageViewHeader: UIView!
//在view出现时添加特性
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let color = UIColor(white: 1, alpha: 1)
//添加渐变效果并跟踪着哪个View
self.navigationController?.navigationBar.ch_addGradient(by: self.tableView,
barColor: color)
//添加缩放视差效果并跟踪着哪个View
self.imageViewHeader.ch_addParallax(by: self.tableView)
}
//在view消失时移除特性
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
//当控制器是消失时,把绑定的跟踪移除
self.navigationController?.navigationBar.ch_removeGradient()
self.imageViewHeader.ch_removeParallax()
}
为了让开发者更积极地分享技术,开源程序代码,我们发起了数字货币捐助计划,只接受以下货币的捐款。
BTC 地址: 1HvgRTi2CmaSHUkfWUCAqkYjF7AiBohzbB
ETH/ETC 地址: 0xc312ed502fb57e0c42f9C7663CB7A3B0A6c4f6D2
CHParallaxHeaderView 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。