gpt4 book ai didi

ios - 如何从包含许多页面的 UIPageViewController 中删除一个页面

转载 作者:行者123 更新时间:2023-12-01 17:08:20 25 4
gpt4 key购买 nike

我的应用程序中有一个 UIPageViewController,用作不同 UICollectionViewControllers 的容器。每个 UICollectionViewController 代表一个新闻源,用户可以添加和理想地从 UIPageViewController 中删除,并在不同的新闻源之间滑动。为了添加新闻源,用户点击 + 按钮,从新加载的 View 中选择一个主题,当返回时,UIPageViewController 加载所有 View 并按预期呈现。到现在为止还挺好。我现在想要实现的是,当用户点击垃圾桶按钮时,当前可见 View 将从 UIPageViewController 中删除,并且只剩下剩余的 View ,同时仍在 UIPageViewController 上。

我完成这项工作的唯一方法是通过按下垃圾桶按钮从 ViewControllers 数组中删除相应的 ViewController,加载新 View ,然后返回 UIPageViewController。

所以基本问题是:如何从 UIPageViewController 中删除 ViewController 并在 UIPageViewController View 上重新加载 UIPageViewController?

非常感谢任何帮助。

最佳答案

如评论中所述,请参阅 UIPageViewController navigates to wrong page with Scroll transition style

以正确的方式设置 viewController。

关于ios - 如何从包含许多页面的 UIPageViewController 中删除一个页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21756116/

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