iOS UIPageViewController page control getting out of sync

北城余情 提交于 2019-12-10 17:02:48

问题


Whenever I swipe the page controller and tap the UIPageControl at the bottom in the opposite direction of the swipe at the same time, the page that is currently being displayed and the page number in the pageControl will be out of sync.

Has anyone ever had this weird issue and solved it?

Let me know if you need any additional info.


回答1:


Just checked out the docs for UIPageControl. I never realized this myself, but you can use page controls for input:

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.

My suggestion would be to either disable the page control or update your app to respond to input on it. Setting userInteractionEnabled to false on my page control resolved the problem for me.



来源:https://stackoverflow.com/questions/36500447/ios-uipageviewcontroller-page-control-getting-out-of-sync

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!