Fix toolbar being too close to screen bottom on non-notched iPhones

This commit is contained in:
Shadowfacts 2020-12-20 14:37:31 -05:00
parent f647402a41
commit 444c4c053d
1 changed files with 4 additions and 1 deletions

View File

@ -107,11 +107,14 @@ class ToolbarView: UIView {
stack.alignment = .fill
stack.translatesAutoresizingMaskIntoConstraints = false
addSubview(stack)
let safeAreaConstraint = stack.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor)
safeAreaConstraint.priority = .defaultHigh
NSLayoutConstraint.activate([
stack.leadingAnchor.constraint(equalTo: leadingAnchor),
stack.trailingAnchor.constraint(equalTo: trailingAnchor),
stack.topAnchor.constraint(equalTo: topAnchor, constant: 5),
stack.bottomAnchor.constraint(equalTo: safeAreaLayoutGuide.bottomAnchor),
safeAreaConstraint,
stack.bottomAnchor.constraint(lessThanOrEqualTo: bottomAnchor, constant: -8)
])
updateNavigationButtons()