8 Replies
      Latest reply on Nov 13, 2019 1:53 PM by Angela_m_Li
      DaleOne Level 1 Level 1 (0 points)

        Hi!

         

        There is a bug in iOS 13 that cause the navigation bar of the second controller presented modally to have a wrong layout.

         

        To reproduce this error present a navigation controller modally (Form Sheet). The navigation bar of this controller will be ok.

        From this controller present another navigation controller modally. The toolbar of the second controller will have a wrong layout. The height is wrong and the button items are not properly aligned (see the image below).

         

        ios13-navigation-bar-issue.png 

         

        The problem disappear after rotating the device.

         

        To fix this issue  you need to manually call the navigation bar setNeedsLayout in the viewWillAppear method of the second controller:

         

        override func viewWillAppear(_ animated: Bool) {
             super.viewWillAppear(animated)
             if #available(iOS 13.0, *) {
                  navigationController?.navigationBar.setNeedsLayout()
             }
        }

         

        Hope this helps.

         

        Alan