diff --git a/WordPress/Classes/ViewRelated/Post/Prepublishing Nudge/PrepublishingNavigationController.swift b/WordPress/Classes/ViewRelated/Post/Prepublishing Nudge/PrepublishingNavigationController.swift index 1eed1b0d73bc..6f41408767ca 100644 --- a/WordPress/Classes/ViewRelated/Post/Prepublishing Nudge/PrepublishingNavigationController.swift +++ b/WordPress/Classes/ViewRelated/Post/Prepublishing Nudge/PrepublishingNavigationController.swift @@ -44,6 +44,8 @@ class PrepublishingNavigationController: LightNavigationController { init(rootViewController: UIViewController, shouldDisplayPortrait: Bool) { self.shouldDisplayPortrait = shouldDisplayPortrait super.init(rootViewController: rootViewController) + + configureNavigationBar() } required init?(coder: NSCoder) { @@ -56,6 +58,20 @@ class PrepublishingNavigationController: LightNavigationController { } } + /// Updates the navigation bar color so it matches the view's background. + /// + /// Originally, in dark mode the navigation bar color is grayish, but there's a few points gap on top of the + /// navigation bar to accommodate the `GripButton` from `BottomSheetViewController`. The bottom sheet itself + /// assigns the background color according to its child controller's view background color. + private func configureNavigationBar() { + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = .basicBackground + + navigationBar.scrollEdgeAppearance = appearance + navigationBar.compactAppearance = appearance + } + private enum Constants { static let iPadPreferredContentSize = CGSize(width: 300.0, height: 300.0) } diff --git a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift index 82e8cedd5aa9..bfcdb79aef7f 100644 --- a/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/PrepublishingViewController.swift @@ -160,9 +160,6 @@ class PrepublishingViewController: UITableViewController { self?.hasSelectedText = true } }) - - // when displayed in a popover, update content size so the window is resized to fit the current content. - navigationController?.preferredContentSize = tableView.contentSize } override func viewWillDisappear(_ animated: Bool) {