Fix SplitNavigationController layout with new sidebar
This commit is contained in:
parent
0e95cd0adf
commit
c113903980
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue