Fix: addHeaderBackground cells overlapping.

This commit is contained in:
Ivan Smolin 2018-04-13 14:00:38 +03:00
parent d87890c83e
commit 9473e46d1b
3 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,8 @@
# Changelog
### 0.7.11
- **Fix**: `addHeaderBackground` cells overlapping.
### 0.7.10
- **Fix**: `wtihInsets` renamed to `with insets`

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "LeadKit"
s.version = "0.7.10"
s.version = "0.7.11"
s.summary = "iOS framework with a bunch of tools for rapid development"
s.homepage = "https://github.com/TouchInstinct/LeadKit"
s.license = "Apache License, Version 2.0"

View File

@ -32,6 +32,8 @@ public extension UITableView {
let backgroundView = UIView()
backgroundView.backgroundColor = color
addSubview(backgroundView)
// don't overlap cells that has out of bounds content
backgroundView.layer.zPosition = -CGFloat(Float.greatestFiniteMagnitude)
backgroundView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([backgroundView.leadingAnchor.constraint(equalTo: leadingAnchor),
backgroundView.bottomAnchor.constraint(equalTo: topAnchor),