alhcr
alhcr

Reputation: 823

How to scroll with UIScrollView with stopping only at pecific regular positions?

I have image that needs to be scrolled in uiscrollview but scrolling needs to be stopped only at specific points. Imagine I have long image of uitableview so I need to scroll it. What I'm thinking about: is it possible to stop scroll only at points where full row is visible at the top? If yes, then how to do it?

Upvotes: 1

Views: 368

Answers (1)

Srikar Appalaraju
Srikar Appalaraju

Reputation: 73688

You need to set the coordinates to where you want the scroll to move. This is done here -

[scrollView scrollRectToVisible:CGRectMake(0, 50, 1536, 939) animated:NO];

So you need to specify the exact CGRect specs you need. But this will work for you.

If you turn animated:YES then the scroll to this new position is smoothly animated.

Upvotes: 1

Related Questions