Fix SplitNavigationController layout with new sidebar

This commit is contained in:
Shadowfacts 2024-08-21 18:37:20 -04:00
parent 0e95cd0adf
commit c113903980
1 changed files with 5 additions and 5 deletions

View File

@ -87,7 +87,7 @@ class SplitNavigationController: UIViewController {
NSLayoutConstraint.activate([
rootNav.view.topAnchor.constraint(equalTo: view.topAnchor),
rootNav.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
rootNav.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
rootNav.view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
separatorView.topAnchor.constraint(equalTo: view.topAnchor),
separatorView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
@ -196,13 +196,13 @@ class SplitNavigationController: UIViewController {
NSLayoutConstraint.deactivate(constraints)
if visible {
constraints = [
rootNav.view.trailingAnchor.constraint(equalTo: view.centerXAnchor),
secondaryNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
secondaryNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
]
} else {
constraints = [
rootNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
secondaryNav.view.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.5),
rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
secondaryNav.view.widthAnchor.constraint(equalTo: rootNav.view.widthAnchor),
]
}
NSLayoutConstraint.activate(constraints)