I have a simple UITableView
; I'm trying to force it to scroll to a certain position in viewDidLoad
, so I can hide the first row in my table (unless a user scrolls up). My first row is 90.0px
in height, so I'm trying this to force my UITableView
to scroll:
[contentTable setContentOffset: CGPointMake(0, 90.0f) animated: NO];
The problem is that using animated: NO
does nothing; the UITableView
will not scroll. If I use animated: YES
, however, things work just fine; it scrolls, but the downside to having it animated is that my UI appears to flash during the scroll, which is not what I want at all.
Any ideas why? It doesn't seem to matter if my UITableView
has 1 row or 20 rows, it will only scroll if I pass animated: YES
to setContentOffset
.
I am currently running Xcode 4.2 and I'm using iOS 4.3.3 on my first-gen iPad.
Edit: One other thing to mention - scrollToRect
doesn't seem to work at all, regardless of what value I pass for it's animated
property. Is there something I'm fundamentally misunderstanding about scrolling on iOS?