Navigation/Toolbar Appearance

Consistent behaviour for Feed and Timeline toolbars.
This commit is contained in:
Stuart Breckenridge
2022-01-29 09:33:49 +08:00
parent 8176f0d9cc
commit 59dacc1b59
2 changed files with 18 additions and 1 deletions

View File

@@ -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) {