Yes, it's not a good idea but can be a solution to your problem.
Follow this steps:
Now hide/unhide your bottomPaddingView
with respect to actionship visibility with fade animation.
Here is my tiny extension. If anybody can suggest an improvement to not access added view by "magic number" tag - welcome!
extension UIViewController {
private static let insetBackgroundViewTag = 98721 //Cool number
func paintSafeAreaBottomInset(withColor color: UIColor) {
guard #available(iOS 11.0, *) else {
return
}
if let insetView = view.viewWithTag(UIViewController.insetBackgroundViewTag) {
insetView.backgroundColor = color
return
}
let insetView = UIView(frame: .zero)
insetView.tag = UIViewController.insetBackgroundViewTag
insetView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(insetView)
view.sendSubview(toBack: insetView)
insetView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
insetView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true
insetView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
insetView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true
insetView.backgroundColor = color
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.