0
votes

My bug:
enter image description here

If navigate from a view controller with large titles enabled to a view controller with large titles disabled i see same bug. Height navigation bar changes not smoothy.

I want animation change height navBar during segue on another viewController like this enter image description here

Common propertyes for navBar set up in BaseNavigationController

class BaseNavigationController: UINavigationController {

override var preferredStatusBarStyle: UIStatusBarStyle {
    return .lightContent
}

override func viewDidLoad() {
    super.viewDidLoad()

    setNavBarTitlesPropertyes()
}

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
}

private func setNavBarTitlesPropertyes() {
    navigationBar.tintColor = .white
    navigationBar.titleTextAttributes = [
        .foregroundColor: UIColor.white
    ]
    if #available(iOS 11.0, *) {
        navigationBar.prefersLargeTitles = true

        navigationBar.largeTitleTextAttributes = [
            .foregroundColor: UIColor.white
        ]
    }
}

And my setting navbar in the storyboard:

enter image description here

1

1 Answers

1
votes

I found solution for this trouble. UINavigationBar property translucent should be true, and also bottom and top constraint for tableView in UIViewController should be equal Superview.Top and Superview.Bottom accordingly.