Fix SplitNavigationController layout with new sidebar
This commit is contained in:
parent
0e95cd0adf
commit
c113903980
|
@ -87,7 +87,7 @@ class SplitNavigationController: UIViewController {
|
||||||
NSLayoutConstraint.activate([
|
NSLayoutConstraint.activate([
|
||||||
rootNav.view.topAnchor.constraint(equalTo: view.topAnchor),
|
rootNav.view.topAnchor.constraint(equalTo: view.topAnchor),
|
||||||
rootNav.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
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.topAnchor.constraint(equalTo: view.topAnchor),
|
||||||
separatorView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
separatorView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
||||||
|
@ -196,13 +196,13 @@ class SplitNavigationController: UIViewController {
|
||||||
NSLayoutConstraint.deactivate(constraints)
|
NSLayoutConstraint.deactivate(constraints)
|
||||||
if visible {
|
if visible {
|
||||||
constraints = [
|
constraints = [
|
||||||
rootNav.view.trailingAnchor.constraint(equalTo: view.centerXAnchor),
|
rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor),
|
||||||
secondaryNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
secondaryNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
|
||||||
]
|
]
|
||||||
} else {
|
} else {
|
||||||
constraints = [
|
constraints = [
|
||||||
rootNav.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
rootNav.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
|
||||||
secondaryNav.view.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 0.5),
|
secondaryNav.view.widthAnchor.constraint(equalTo: rootNav.view.widthAnchor),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
NSLayoutConstraint.activate(constraints)
|
NSLayoutConstraint.activate(constraints)
|
||||||
|
|
Loading…
Reference in New Issue