From aa2d333f4a3be23f50d6254c5d3ad5a56d4b371c Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Thu, 10 Jun 2021 10:55:09 -0400 Subject: [PATCH] Disable transparent nav bar on page view controllers --- Tusker/Screens/Profile/ProfileViewController.swift | 7 +++++++ Tusker/Screens/Utilities/SegmentedPageViewController.swift | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Tusker/Screens/Profile/ProfileViewController.swift b/Tusker/Screens/Profile/ProfileViewController.swift index cac6d221..7bd58502 100644 --- a/Tusker/Screens/Profile/ProfileViewController.swift +++ b/Tusker/Screens/Profile/ProfileViewController.swift @@ -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) { diff --git a/Tusker/Screens/Utilities/SegmentedPageViewController.swift b/Tusker/Screens/Utilities/SegmentedPageViewController.swift index a9457976..787c6fd3 100644 --- a/Tusker/Screens/Utilities/SegmentedPageViewController.swift +++ b/Tusker/Screens/Utilities/SegmentedPageViewController.swift @@ -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) {