iOS UIPageViewController 页面控件不同步

标签 ios uipageviewcontroller

每当我滑动page controller,同时在滑动的相反方向点击底部的UIPageControl,当前显示的页面和pageControl中的页码将不同步。

有没有人遇到过这个奇怪的问题并解决了?

如果您需要任何其他信息,请告诉我。

最佳答案

刚刚查看了 UIPageControl 的文档。我自己从未意识到这一点,但您可以使用页面控件进行输入:

When a user taps a page control to move to the next or previous page, the control sends the UIControlEventValueChanged event for handling by the delegate. The delegate can then evaluate the currentPage property to determine the page to display. The page control advances only one page in either direction.

我的建议是禁用页面控件或更新您的应用程序以响应其上的输入。在我的页面控件上将 userInteractionEnabled 设置为 false 解决了我的问题。

关于iOS UIPageViewController 页面控件不同步,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36500447/

相关文章:

ios - 以编程方式创建部分屏幕 UIPageViewController

ios - Xamarin UI 测试无法识别 iOS 应用程序的系统对话框

ios - 是否可以同时在屏幕上激活来自 2 个不同 Storyboard的 2 个 View Controller ?

ios - 如何检测功能中的手指位置

swift - 如何在 UIPageViewController 中重复使用同一个 ViewController?

ios - 如何关闭 UIPageViewController?

ios - 无法使用自动布局将简单的自调整大小 Collection View 单元格调整为标签大小

ios - 在 UIButton 操作上,设备的 Taptic 不起作用

ios - UIPageViewController 在我的 UIImage 的底部创建一个边框以及如何摆脱它

ios - iPad3 中带有图像的 UIPageViewController 在内存中缓存所有 View Controller