Reputation: 93
I have a UIScrollView on a UITabBar app. If the scrollview is left scrolled down when i change to a different view when changing back to it the position it was left in becomes the new top and i cannot scroll back up and there is whitespace added to the bottom. How can i stop this from happening?
I have written a temporary fix by setting ViewWillDisappear to scroll to top.
Upvotes: 0
Views: 201
Reputation: 13
I was having the same problem and I also fixed it with viewWillDisappear. Here is the code I used.
-(void)viewWillDisappear:(BOOL)animated{
[scroller2 scrollRectToVisible:CGRectMake(0,0,320, 1297) animated:NO];
[super viewWillDisappear:animated];
Upvotes: 1