7

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

pkamb
  • 33,281
  • 23
  • 160
  • 191
chrisz
  • 75
  • 4

1 Answers1

3

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.

DonMag
  • 69,424
  • 5
  • 50
  • 86
  • I understand. Do you think it is possible to use the "ContainerView" into a "UIScrollView" for this issue ? – chrisz Feb 05 '19 at 19:16
  • If you replace ContainerView with a ScrollView, and then try to add a PageViewController (that uses table views) as a subview of the scroll view, I expect you'll have additional navigation issues and conflicting scroll action issues. Tough to say without understanding your full UI / flow. – DonMag Feb 05 '19 at 20:32