remove safe area for now until i can find consistency with contentView

This commit is contained in:
Pfeil, Scott Robert 2020-04-22 19:34:43 -04:00
parent c82b865404
commit 07b02963a6

View File

@ -177,8 +177,8 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
topConstraint?.isActive = false topConstraint?.isActive = false
view.addSubview(topView) view.addSubview(topView)
topView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true topView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
topView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor).isActive = true topView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
view.safeAreaLayoutGuide.rightAnchor.constraint(equalTo: topView.rightAnchor).isActive = true view.rightAnchor.constraint(equalTo: topView.rightAnchor).isActive = true
tableView.topAnchor.constraint(equalTo: topView.bottomAnchor).isActive = true tableView.topAnchor.constraint(equalTo: topView.bottomAnchor).isActive = true
} else { } else {
topConstraint?.isActive = true topConstraint?.isActive = true
@ -208,21 +208,19 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
bottomConstraint?.isActive = false bottomConstraint?.isActive = false
view.addSubview(bottomView) view.addSubview(bottomView)
bottomView.topAnchor.constraint(equalTo: tableView.bottomAnchor).isActive = true bottomView.topAnchor.constraint(equalTo: tableView.bottomAnchor).isActive = true
bottomView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor).isActive = true bottomView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true
view.safeAreaLayoutGuide.rightAnchor.constraint(equalTo: bottomView.rightAnchor).isActive = true view.rightAnchor.constraint(equalTo: bottomView.rightAnchor).isActive = true
view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: bottomView.bottomAnchor).isActive = true view.safeAreaLayoutGuide.bottomAnchor.constraint(equalTo: bottomView.bottomAnchor).isActive = true
} else { } else {
bottomConstraint?.isActive = true bottomConstraint?.isActive = true
} }
var y: CGFloat?
if let tableFooterView = tableView.tableFooterView { // if footer already exists, use the same y location to avoid strange moving animation
// if footer already exists, use the same y location to avoid strange moving animation let y = tableView.tableFooterView?.frame.minY ?? 0.0
y = tableFooterView.frame.minY
}
// This extra view is needed because of the wonkiness of apple's table footer. Things breaks if using autolayout. // This extra view is needed because of the wonkiness of apple's table footer. Things breaks if using autolayout.
MVMCoreUIUtility.sizeView(toFit: footerView) MVMCoreUIUtility.sizeView(toFit: footerView)
let tableFooterView = UIView(frame: CGRect(x: 0, y: y ?? 0, width: MVMCoreUIUtility.getWidth(), height: footerView.frame.height)) let tableFooterView = UIView(frame: CGRect(x: 0, y: y, width: MVMCoreUIUtility.getWidth(), height: footerView.frame.height))
tableFooterView.addSubview(footerView) tableFooterView.addSubview(footerView)
NSLayoutConstraint.constraintPinSubview(toSuperview: footerView) NSLayoutConstraint.constraintPinSubview(toSuperview: footerView)
tableView.tableFooterView = tableFooterView tableView.tableFooterView = tableFooterView
@ -232,7 +230,7 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
/// Subclass for a top view. /// Subclass for a top view.
open func viewForTop() -> UIView { open func viewForTop() -> UIView {
// Small height is needed to stop apple from adding padding for grouped tables when no header. // Small height is needed to stop apple from adding padding for grouped tables when no header.
return MVMCoreUICommonViewsUtility.getView(with: 1) return MVMCoreUICommonViewsUtility.getView(with: 0.5)
} }
/// Subclass for a bottom view. /// Subclass for a bottom view.