I just noticed this issue in my app. I don't wan't to have Large titles at all, so this is the code that I'm calling in my viewDidLoad()
...
//MARK: - Navigation Bar Setup
func navConAcc() {
let addBarButton = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(addWorkout))
navigationItem.rightBarButtonItem = addBarButton
navigationController!.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor(red: 0.4784, green: 0.0863, blue: 0, alpha: 1.0)]
navigationController?.navigationBar.prefersLargeTitles = false
navigationController?.navigationItem.largeTitleDisplayMode = .never
navigationItem.title = "My workouts"
}
As you can see, I have large titles set to false and display mode set to .never
, so when this viewController loads up for the first time, there are no issues with the title size, but if I segue to the next viewController where I have prefersLargeTitles
set to true, and then I subsequently go back to the first viewController and scroll down, the title in my first viewController switches to Large for some reason. Can someone explain to me why this happens?