Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation bar with "Prefers Large Titles" and embedded PageViewController not collapsing

I have setup a "UIViewController" (Embedded in "UINavigationController"), and the "UIViewController" has a "ContainerView" with a "UIPageViewController".

In the "UIPageViewController" are few subviews with "UITableViews".

The problem is now, the "UINavigationBar" with enabled "Prefer Large Titles" are not collapsing if the TableView (Embedded in ContainerView) scrolls.

I think that's a problem with the "UIPageViewController". The size is the same as the ContainerView.

How can I fix this issue ?

See Screenshot

like image 232
chrisz Avatar asked Feb 05 '19 17:02

chrisz


1 Answers

Auto-collapsing large title bars are only active if the "root" view of the controller is a tableview or a scrollview.

Since your tableviews are embedded in a containerView, the title bar has no knowledge of what's going on inside that containerView.

Offhand, I'd say you would have to use a delegate / protocol pattern to have your embedded tableview (controller) tell the containerView containing view controller to change the size of the title bar.

like image 55
DonMag Avatar answered Oct 20 '22 12:10

DonMag