Search code examples
swiftnavigationbarios13large-titlepreferslargetitles

NavigationBar large title not collapse when I have custom image/view under tableView iOS 13


I have an issue with collapsing navigation bar with largeTitles enabled. Basically if there is nothing under the table view, everything is working fine. Once I am adding a default image under the table view, scroll is working on table view, but large navigation bar is stuck in large position.

Any idea for this?enter image description here


Solution

  • So, after a long search and a lot of tries, finally I figure out in a different way:

    tblSettings.backgroundView = UIImageView(image: UIImage(named: "yourImageName"))

    Setting backgroundView to UITableView it will allow navigation bar to animate properly to large and normal titles.

    Hope this will someone!