试试这个!
- Add an empty page before your first page (and optionally set it to be hidden)
- After you have made the setup for your UIPageViewController, manually go to the second page, your first page.
- In the pageViewController:viewControllerBeforeViewController: delegate method, check if the view will be the empty page. If so,
- manually go to the second page again, maybe after some delay. Or
- In some sort of way, disable the UIPanGestureRecognizer in your UIPageViewController
This may not be the perfect solution, but hopefully acceptable.
I m also going to do something like this later, so I ll maybe explain more then and try it out myself. Good luck!
//Edit
如果你想最后取得反弹效果(我建议你同时这样做),
- Skip this.
- Add an extra (or two if you have an odd number of pages and double-sided view) empty page(s) after all your other pages (and optionally set it/them to be hidden)
- In the pageViewController:viewControllerAfterViewController: delegate method, check if the view will be the (last) empty page. If so,
- manually go to the previous page, maybe after some delay. Or
- In some sort of way, disable the UIPanGestureRecognizer in your UIPageViewController
在 (3) 中, 如果您没有禁用 UITapGestureRecognizeer, 您将不得不决定是否是自动手势, 然后选择( 3 1), 其它选择( 3. 2) 路线!