views:

143

answers:

2

I have a UIScrollView with pagingEnabled on and I want to (using like a button or something) animated(ly) zoom to each page. I am using zoom to rect, but that's not working. Please help.

A: 

Try the following to scroll a pageof the paged scroll view (assuming that all pages have equal width):

CGRect frame = scrollView.frame;
frame.origin.x = frame.size.width * page;
frame.origin.y = 0;
[scrollView scrollRectToVisible:frame animated:YES]; 
Felix
+3  A: 

Try to use - (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated instead as you (probably) do not want to change view's zoom anyway.

Vladimir