From 59dacc1b59a4fc7e3c7a3e65d2834541adb02555 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Sat, 29 Jan 2022 09:33:49 +0800 Subject: [PATCH] Navigation/Toolbar Appearance Consistent behaviour for Feed and Timeline toolbars. --- iOS/MasterFeed/MasterFeedViewController.swift | 2 +- .../MasterTimelineViewController.swift | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/iOS/MasterFeed/MasterFeedViewController.swift b/iOS/MasterFeed/MasterFeedViewController.swift index 158b33b68..60338f2de 100644 --- a/iOS/MasterFeed/MasterFeedViewController.swift +++ b/iOS/MasterFeed/MasterFeedViewController.swift @@ -723,7 +723,7 @@ private extension MasterFeedViewController { scrollEdge.shadowImage = UIImage() let standard = UINavigationBarAppearance() - standard.shadowColor = nil + standard.shadowColor = .opaqueSeparator standard.shadowImage = UIImage() navigationController?.navigationBar.standardAppearance = standard diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index ee682813c..6743e04e2 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -93,6 +93,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner refreshControl!.addTarget(self, action: #selector(refreshAccounts(_:)), for: .valueChanged) configureToolbar() + configureNavbar() resetUI(resetScroll: true) // Load the table and then scroll to the saved position if available @@ -621,6 +622,22 @@ private extension MasterTimelineViewController { let refreshProgressItemButton = UIBarButtonItem(customView: refreshProgressView) toolbarItems?.insert(refreshProgressItemButton, at: 2) } + + func configureNavbar() { + let scrollEdge = UINavigationBarAppearance() + scrollEdge.configureWithOpaqueBackground() + scrollEdge.shadowColor = nil + scrollEdge.shadowImage = UIImage() + + let standard = UINavigationBarAppearance() + standard.shadowColor = .opaqueSeparator + standard.shadowImage = UIImage() + + navigationController?.navigationBar.standardAppearance = standard + navigationController?.navigationBar.compactAppearance = standard + navigationController?.navigationBar.scrollEdgeAppearance = scrollEdge + navigationController?.navigationBar.compactScrollEdgeAppearance = scrollEdge + } func resetUI(resetScroll: Bool) {