Satyam Satyam - 4 months ago 6x
Objective-C Question

iphone - prevent uiscrollview from scrolling by touch

I've a scrollview and on both sides, I've two buttons left and right.

when i click the scroll view will move left and when right button is clicked it will move right side. My scrollview has 20 buttons (approx) & on click of each button some action is performed.

Everything is perfectly implemented and working fine.

Only thing i couldn't implement is to prevent scrolling by touch. I don't want user to scroll the scrollview manually. How can i prevent it from scrolling by touch and still able to click the buttons inside the scrollview ?


Try setting yourScrollView.scrollEnabled = NO;. That should do exactly what you want.