Why does my UIScrollView change it's original content offset when I scroll?

Posted by Tony on Stack Overflow See other posts from Stack Overflow or by Tony
Published on 2010-04-16T22:42:15Z Indexed on 2010/04/16 23:33 UTC
Read the original article Hit count: 295

Filed under:
|
|

Before I scroll, my UIScrollView is laid out perfectly. See here

However if I scroll up, the view bounces as I go out of bounds and then resets too high. See here

I am going to guess this has to do with a hack that I did earlier to get the view to originally show like in the first screen shot. For some reason, to get my view to look like the second screen shot, I do:

[scrollView setContentOffset:CGPointMake(0,-50) animated:YES];

in viewDidLoad

But if I set the content offset to 0,0 in viewDidLoad, I get something that looks like the second screen shot when the view loads.

This doesn't make much sense to me because if the content offset is 0,0 I would think the content should begin in the upper right corner of the screen.

Does anyone know what could be going on here?

Thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c