From 9672571d9974e30740673cd183063c511349422c Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Mon, 24 Jan 2022 21:22:53 +0800 Subject: [PATCH] Bars Feeds: navigation bar and tab bar appear/disappear correctly when scrolling Timeline: navigation bar and tab bar appear/disappear correctly when scrolling Articles: Hmm, not so much. --- iOS/Base.lproj/Main.storyboard | 33 +++++++++---------- .../InteractiveNavigationController.swift | 22 +++++-------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 44386a8f9..4ccb0e39a 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -1,9 +1,8 @@ - + - - + @@ -13,13 +12,13 @@ - + @@ -113,14 +112,14 @@ - - - + + + - + @@ -166,7 +165,7 @@ - + @@ -316,26 +315,26 @@ - - + diff --git a/iOS/UIKit Extensions/InteractiveNavigationController.swift b/iOS/UIKit Extensions/InteractiveNavigationController.swift index 1b7ddda05..7054341ae 100644 --- a/iOS/UIKit Extensions/InteractiveNavigationController.swift +++ b/iOS/UIKit Extensions/InteractiveNavigationController.swift @@ -46,19 +46,8 @@ private extension InteractiveNavigationController { func configure() { isToolbarHidden = false - let navigationStandardAppearance = UINavigationBarAppearance() - navigationStandardAppearance.titleTextAttributes = [ - .foregroundColor: UIColor.label, - .font: UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .body).pointSize, weight: .heavy) - ] - navigationStandardAppearance.largeTitleTextAttributes = [ - .foregroundColor: UIColor.green, - .font: UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .largeTitle).pointSize - 3, weight: .black) - ] - navigationBar.standardAppearance = navigationStandardAppearance - let scrollEdgeStandardAppearance = UINavigationBarAppearance() - scrollEdgeStandardAppearance.backgroundColor = .systemBackground + scrollEdgeStandardAppearance.shadowColor = nil scrollEdgeStandardAppearance.titleTextAttributes = [ .foregroundColor: UIColor.label, @@ -68,11 +57,16 @@ private extension InteractiveNavigationController { .foregroundColor: UIColor.label, .font: UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .largeTitle).pointSize - 3, weight: .black) ] - navigationBar.scrollEdgeAppearance = scrollEdgeStandardAppearance - navigationBar.tintColor = AppAssets.primaryAccentColor + navigationBar.standardAppearance = scrollEdgeStandardAppearance + navigationBar.isTranslucent = true + navigationBar.scrollEdgeAppearance = nil + navigationBar.compactAppearance = nil + navigationBar.compactScrollEdgeAppearance = nil + let toolbarAppearance = UIToolbarAppearance() + toolbarAppearance.shadowColor = nil toolbar.standardAppearance = toolbarAppearance toolbar.compactAppearance = toolbarAppearance toolbar.tintColor = AppAssets.primaryAccentColor