Can someone help out with an animation issue I can’t figure out. I have the following code that I’m implementing in a “pull to refresh”.
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
self.tableView.contentInset = UIEdgeInsetsMake(50, 0, 0, 0);
[UIView commitAnimations];
This method also gets called in viewDidAppear: and that’s where my problem comes in. On the initial load of the app, it works great. However, when the view appears after popping off a view or dismissing a modal view, it doesn’t animate. I’ve set up breakpoints before and after, so I know it’s getting called, but no animation. I’ve also tried other animations in place of the contentInset, and they work fine. And to top it off, if I change the content inset to negative, it doesn’t work on the initial load, but works great in all other situations (obviously moving in the opposite direction though).
I really appreciate any help
So, the animation code I listed still seems to act oddly, but at least my purpose is served by adding
to the bottom. This way, if the tableView is currently near the top when the view appears, the contentInset is changed to include the “Loading” header, then the tableView scrolls to the top of that header.