问题
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