ios - 如何添加具有动态宽度的 UIPageViewController

标签 ios cocoa-touch uipageviewcontroller

我有 8 个带有 UIPageViewController 的 viewController。我想要一个 pageViewController 和 cildViewControllers 具有动态 View 宽度和填充,如下所示:

http://i.imgur.com/zf5xPyA.png?1

我可以使用 UIPageViewController 来做到这一点吗?我该如何做到这一点?我知道我可以只使用 pageControl 和 UIViews 来完成此操作,但我更喜欢使用 childViewControllers 来完成此操作。

最佳答案

在子 VC 中 - 更新您的 preferredContentSize 属性

关于ios - 如何添加具有动态宽度的 UIPageViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28787431/

相关文章:

ios - 在 Swift 中页面 View Controller 内的 View Controller 之间传递数据

ios - 计算请求和响应执行时间

ios - Segue 不设置目标 View Controller 的属性

ios - 如何解析数组中的字典,该数组位于字典中

ios - 扩展 UIViewController 以访问应用委托(delegate)是一种反模式吗?

objective-c - 分组 TableView ——节间距

iphone - 即使使用字符串初始化后,NSURL对象也为零

iOs 模态转换,如 Mailboxapp

ios - QuickBlox:错误!!框架更新后无法在设备中运行应用程序

autolayout - iOS 8 UIPageViewController 在转换后应用约束