简体   繁体   English

导航栏带有“首选大标题”且嵌入式PageViewController不崩溃

[英]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". 我已经设置了“ UIViewController”(嵌入在“ UINavigationController”中),并且“ UIViewController”具有带有“ UIPageViewController”的“ ContainerView”。

In the "UIPageViewController" are few subviews with "UITableViews". 在“ UIPageViewController”中,带有“ UITableViews”的几个子视图。

The problem is now, the "UINavigationBar" with enabled "Prefer Large Titles" are not collapsing if the TableView (Embedded in ContainerView) scrolls. 现在的问题是,如果TableView(包含在ContainerView中)滚动,则启用了“ Prefer Large Titles”的“ UINavigationBar”不会崩溃。

I think that's a problem with the "UIPageViewController". 我认为这是“ UIPageViewController”的问题。 The size is the same as the ContainerView. 大小与ContainerView相同。

How can i fix this issue ? 我该如何解决这个问题?

See Screenshot 见截图

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. 由于您的表视图是嵌入在containerView中的,因此标题栏不知道该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. 暂时,我要说的是,您将必须使用委托/协议模式来使嵌入式tableview(控制器)告诉包含视图控制器的containerView更改标题栏的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM