Large Title Navigation Bar Problems with Two Views

As has been posted a number of times, the large title navigation bar only collapses on scrolling for the UIView listed first in an .xib or storyboard file.

In my case, I have an enclosing view containing 2 Views, a TableView and a CollectionView in an .XIB file. This is connected to a UIKit class. Tapping a button switches between the two views. If the TableView is the first view listed, the navigationbar collapses with scrolling but with the CollectionView listed second, the large title navigation bar doesn't collapse with scrolling. Alternatively, if the CollectionView is the first view listed, the navigation bar collapses with scrolling but with the TableView listed second, the large title navigation bar doesn't collapse with scrolling.

I have not been able to figure out a way to enable the collapsable large title navigation bar to work in such a scenario as mine for both views within a container view. Is there a way to do this? I have tested this capability through iOS 17.

Answered by Frameworks Engineer in 794115022

In iOS 15 UIViewController added setContentScrollView:forEdge: to allow you to explicitly specify the scroll view to be used for this case. There is no solution to allow the large title to respond to multiple scroll views simultaneously however.

Accepted Answer

In iOS 15 UIViewController added setContentScrollView:forEdge: to allow you to explicitly specify the scroll view to be used for this case. There is no solution to allow the large title to respond to multiple scroll views simultaneously however.

Worked perfectly. Thank you!

Large Title Navigation Bar Problems with Two Views
 
 
Q