UIPageControl tap to "swipe"?

runmad picture runmad · Dec 14, 2009 · Viewed 7k times · Source

What method to I use to make my UIScrollView update when the sides of a UIPageControl are tapped? When swiping the UIScrollView, the UIPageControl is updated correctly, but if I tap the sides of the UIPageControl to go to the next page, only the dots update, but the UIScrollView won't swipe. I've looked in the docs and am unable to find any methods for this?

If you're unsure of what I mean, go to your iPhone home screen and tap either side of the white dots, right between the dock and the paged icons.

Answer

Ben Gottlieb picture Ben Gottlieb · Dec 14, 2009

Just make sure you're giving your page control enough width, and you've hooked up its Value Changed outlet. If you do this, you should get messages when its value changes; look at the currentPage property on the control. It handles left- and right-margin taps properly.