UIPageViewController - 如何可以跳转到特定的页码? [英] UIPageViewController - how Can I jump to a particular page number?

查看:399
本文介绍了UIPageViewController - 如何可以跳转到特定的页码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了差不多8个小时了解如何跳转到UIPageViewController中的特定页码...下面是我的项目看起来像

I have spent almost 8 hours finding out how to jump to a particular page number in UIPageViewController... below is what my project looks like

一个看起来像Ibooks的应用程序---

I want to make an app which looks like Ibooks---

我从这里提供的代码中获取了帮助 - http://www.ioslearner.com/tag/uipageviewcontroller-sample-code/

I have taken the help from the code presented here - http://www.ioslearner.com/tag/uipageviewcontroller-sample-code/

我已经一个plist和UITableView,我从TableView中选择值,并显示在WebView放置在UIPAgeiewController相同,但问题是,只有在Web视图中的页面更改,而不是实际页码UIPageViewController ....

I have made a plist and UITableView , I select the value from TableView and display the same on webView placed on UIPAgeiewController, but the problem is that only the page in web view changes and not the actual page number of the UIPageViewController....

如果我缩小我的问题,看起来像是---有一种方法在UIPageViewController中的页码之间切换.... ???

If I narrow down my question it would look like --- is there a way to switch between page numbers in UIPageViewController.... ???

推荐答案

您必须实例化管理您要跳转到的页面的视图控制器,然后调用页面视图控制器的 setViewControllers:direction:animated:completion:方法,传递新的视图控制器。

You have to instantiate the view controller(s) that manage the page(s) you want to jump to and then call the page view controller's setViewControllers:direction:animated:completion: method, passing the new view controller(s).

这篇关于UIPageViewController - 如何可以跳转到特定的页码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆