gpt4 book ai didi

ios - UIPageViewController 更新页数

转载 作者:行者123 更新时间:2023-11-29 11:46:16 28 4
gpt4 key购买 nike

大家好,我想看看是否有人知道如何更新 UIPageViewController 中的页面数

UIPageViewController 有方法

- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController {
return count;
}

但那是在开始时调用的,没有办法更新它。使用 TableView ,您可以调用 [tableView reloadData]

有谁知道如何“重新加载”UIPageViewController 的数据?

谢谢大家

最佳答案

使用 UIPageViewController 的 setViewControllers 方法:

- (void)setViewControllers:(NSArray<UIViewController *> *)viewControllers 
direction:(UIPageViewControllerNavigationDirection)direction
animated:(BOOL)animated
completion:(void (^)(BOOL finished))completion;

在 UIPageViewController 上调用此方法,并将它传递给您想要呈现的 View Controller 。

关于ios - UIPageViewController 更新页数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43712682/

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