Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIScrollView with images

Hey, So I have 5 images I want in a UIScrollView the user can scroll thru. But i want the scrollview to stop at every image so you'll have to scroll again to see the next image.

How would I do this?

like image 384
inFever Avatar asked Dec 08 '25 12:12

inFever


1 Answers

You can use

myuiscrollview.pagingEnabled = YES;

for a simple way which means that the scroll view will stop on multiple of its relevant axis bounds.

But if you want to get a bit cleverer you can use the delegate method

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

and use the contentOffset property to stop at the point you want

like image 69
Warren Burton Avatar answered Dec 11 '25 06:12

Warren Burton