gpt4 book ai didi

ios - UIPageViewController 中的离屏页面限制

转载 作者:行者123 更新时间:2023-11-28 15:17:02 25 4
gpt4 key购买 nike

我想在开始时加载 UIPageViewController 中的所有页面。在 Android 中使用 View 寻呼机的 setOffScreenPageLimit 方法很容易。是否有可能 swift 实现这一目标?

最佳答案

是也不是。您可以一次手动将一个或两个 Controller 传递给您的 UIPageViewController 或实现 UIPageViewControllerDataSource 以在需要时调用和获取 Controller 。

When defining a page view controller interface, you can provide the content view controllers one at a time (or two at a time, depending upon the spine position and double-sided state) or as-needed using a data source. When providing content view controllers one at a time, you use the setViewControllers(_:direction:animated:completion:) method to set the current content view controllers. To support gesture-based navigation, you must provide your view controllers using a data source object. The data source for a page view controller is responsible for providing the content view controllers on demand and must conform to the UIPageViewControllerDataSource protocol. The delegate object—an object that conforms to the UIPageViewControllerDelegate protocol—provides some appearance-related information and receives notifications about gesture-initiated transitions. This class is generally used as-is, but can also be subclassed.

https://developer.apple.com/documentation/uikit/uipageviewcontroller

关于ios - UIPageViewController 中的离屏页面限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46670280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com