Disable transparent nav bar on page view controllers

This commit is contained in:
Shadowfacts 2021-06-10 10:55:09 -04:00
parent c8a45d8eef
commit aa2d333f4a
2 changed files with 14 additions and 0 deletions

View File

@ -96,6 +96,13 @@ class ProfileViewController: UIPageViewController {
.sink { [weak self] (_) in self?.updateAccountUI() }
loadAccount()
// disable the transparent nav bar because it gets messy with multiple pages at different scroll positions
if let nav = navigationController {
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
nav.navigationBar.scrollEdgeAppearance = appearance
}
}
override func viewDidAppear(_ animated: Bool) {

View File

@ -44,6 +44,13 @@ class SegmentedPageViewController: UIPageViewController, UIPageViewControllerDel
addKeyCommand(MenuController.prevSubTabCommand)
addKeyCommand(MenuController.nextSubTabCommand)
// disable the transparent nav bar because it gets messy with multiple pages at different scroll positions
if let nav = navigationController {
let appearance = UINavigationBarAppearance()
appearance.configureWithDefaultBackground()
nav.navigationBar.scrollEdgeAppearance = appearance
}
}
func selectPage(at index: Int, animated: Bool) {