Thursday, 21 November 2019

iOS 13 Navigation Bar Large Title Issue

I am trying to show a large Title in a Navigation bar, but with clear background. When scrolled up, for it to be a bar with blur effect.

enter image description here

enter image description here

This looks correct, how ever, when scrolling, the animation seems to be broken. Also, transition gets stuck time to time:

enter image description here

enter image description here

My code as follows:

UINavigationController:

override func viewDidLoad() {
   super.viewDidLoad()

   if #available(iOS 13.0, *) {

      self.navigationBar.prefersLargeTitles = true

      let style = UINavigationBarAppearance()
      style.configureWithDefaultBackground()

      style.titleTextAttributes = [.font: UIFont.systemFont(ofSize: 18)]

      self.navigationBar.standardAppearance = style
      self.navigationBar.compactAppearance = style


      //Configure Large Style
      let largeStyle = UINavigationBarAppearance()
      largeStyle.configureWithTransparentBackground()

      largeStyle.largeTitleTextAttributes = [.font: UIFont.systemFont(ofSize: 28)]

      self.navigationBar.scrollEdgeAppearance = largeStyle

   }
}

UITableView is inside UINavigationController. Both are from storyboards via a segue way.



from iOS 13 Navigation Bar Large Title Issue

No comments:

Post a Comment