title: UIScrollView changes bounds
body: <p>I'm using a Navigation Controller for navigation.</p>
  
  <p>My root view controller's UIView contains a UIScrollView which I added in the IB. I find that depending on my scrollView's current visible part, when I navigate from this view to another and return back, I find things very arbit. </p>
  
  <p>Hope this description helps</p>
  
  <p>When I dont scroll at all, there is no effect.</p>
  
  <p><img src="https://i.stack.imgur.com/pjBmc.png" alt="Initial Image"></p>
  
  <p>When I move forward and return back it remains the same.
  However, when I scroll to the bottom of my scrollview as shown in the following figure</p>
  
  <p><img src="https://i.stack.imgur.com/ZdeNg.png" alt="Initial With Scroll"></p>
  
  <p>Then navigating forward and then immediate backward lands me on this pic
  <img src="https://i.stack.imgur.com/yhrLK.png" alt="Final State"></p>
  
  <p>Finally, I logged all the bounds, frame, content size of this scrollview to find the following weird change </p>
  
  <pre><code>2013-05-19 14:16:54.139 app2[1302:c07] {{0, 0}, {320, 392}}
  2013-05-19 14:16:54.139 app2[1302:c07] {320, 456}
  2013-05-19 14:16:54.140 app2[1302:c07] {{0, 0}, {320, 392}}
  </code></pre>
  
  <p>The above is the initial bounds, contentSize, frame respectively.
  The below is after the navigation and back.</p>
  
  <pre><code>2013-05-19 14:20:47.490 app2[1302:c07] {{0, 64}, {320, 392}}
  2013-05-19 14:20:47.490 app2[1302:c07] {320, 456}
  2013-05-19 14:20:47.491 app2[1302:c07] {{0, 0}, {320, 392}}
  </code></pre>
  
  <p>I dont know what I did wrong. Please help me.</p>
  
  <p><strong>Code</strong>
  This is the code, manipulating the scrollView</p>
  
  <pre><code>[self.scrollView setCanCancelContentTouches:YES];
  [self.scrollView setDelaysContentTouches:NO];
  [self.scrollView setFrame:self.view.frame];
  [self.scrollView setBounds:self.view.bounds];
  
  
  - (IBAction)moreFiltersFunction:(UIButton*)sender {
  sender.selected = !sender.isSelected;
  if (sender.isSelected) {
      [self.scrollView addSubview:self.moreFiltersView];
      [self.scrollView setContentSize:CGSizeMake(320, self.scrollView.frame.size.height + 280)];
      [self.scrollView scrollRectToVisible:self.moreFiltersView.frame animated:YES];
  } else {
      [self.moreFiltersView removeFromSuperview];
      [self.scrollView setContentSize:CGSizeMake(320, self.view.frame.size.height)];
  }
  </code></pre>
  
  <p>}</p>