title: UITextView contentoffset update not working
body: <p>I'm attempting to vertically align a UITextView by setting the content offset appropriately.</p>
  
  <p>I'm calling the following code when I change the text of my textView:</p>
  
  <pre><code>- (void)setCenterVerticalAlignmentForTextView:(UITextView*)textView {
      CGFloat topCorrect = ([textView bounds].size.height - [textView contentSize].height * [textView zoomScale])/2.0;
      topCorrect = (topCorrect &lt; 0.0 ? 0.0 : topCorrect );
      textView.contentOffset = CGPointMake(0,-topCorrect);
  }
  </code></pre>
  
  <p>This works perfectly the first time the UIView is shown on the screen.  </p>
  
  <p>However, if I change the text inside the textView and call this function again, the last line of the function which sets the contentOffset doesn't seem to make any difference. The content offset becomes (0,0) no matter what I set.</p>
  
  <p>Do I need to do something to reset the contentOffset or contentInset before I attempt to reset it?</p>
  
  <p>Thanks guys,  any help much appreciated.</p>
  
  <p>Duncs  </p>