- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想创建一个 UIPageViewController
,它只使用一个 UIViewController
,但它的每个新实例每次都会保存不同的数据。 UIPageViewController
需要在每次 [previous][current][ 时持有 3 个 UIViewController
实例next] 并随时加载下一个或上一个。重要的是要说明我不使用 Storyboard。
我找到了 this链接,但我不知道该怎么做,因为在 setupPageController()
上,他正在使用他之前创建的 UIViewControllers
初始化 UIPageViewController
( pageViewController.setViewControllers
)
这样做的正确和最佳方法是什么?
最佳答案
The UIPageViewController needs to hold 3 instances
不,不是。页面 View Controller 没有固定的页面集;它只有一页。您无需提前计划来提前创建任何其他页面。这就是重点。当您收到用户想要下一页或上一页的通知时,您可以立即决定它是什么并创建它。您可以使用任何您喜欢的逻辑。
关于ios - UIPageViewController 具有未知数量的 UIViewController 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53749661/
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Combination of List> 我有多个列表,可以是 2 个或 3 个,最多 10 个列表,有多个
我是一名优秀的程序员,十分优秀!