使用导航 View Controller ,我可以提供“垂直覆盖”过渡样式动画。但是,使用页面 View Controller 复制该内容时遇到困难。 Storyboard中给出的唯一选项是“滚动”和“卷页”。有没有办法以编程方式执行此操作?
最佳答案
看起来有点棘手,但应该可以:
创建一个 UIViewController,它将成为容器 Controller 。在您想要的位置添加 UIPageControl。然后以编程方式添加 UINavigationViewController 作为容器的子级,并将其 View 添加到 View 层次结构中。您可以使用主 Storyboard的 instantiateViewControllerWithIdentifier: ,并且如果您使用 AutoLayout,请不要忘记为其设置约束。当用户在 UINavigationViewController 中导航时,使用容器和 UINavigationViewController 或 UINavigationViewController 的parentViewController 属性之间的委托(delegate)来更改 UIPageControl。
UIPageViewController 适合只做一件事。大多数时候我更喜欢使用自定义容器 Controller 而不是使用它。
关于ios - 如何为页面 View Controller 提供 "Cover Vertical"过渡样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31121565/