title: Disable Horizontal Scrolling to UITextView Programmatically
body: <p>I'm looking for a way to disable horizontal scrolling of a UITextView programmatically, it was easy via the Interface Builder, but since I'm designing the view programmatically I can't find a way to do this, I've googled it as well but the most I got was this:</p>
  
  <p><a href="https://stackoverflow.com/questions/2801126/how-to-stop-the-horizontal-scrolling-programmatically">How to stop the horizontal scrolling programmatically?</a></p>
  
  <p>and it is not working.
  Any hints?</p>
  
  <pre><code>self.textViewOpenedRect = CGRectMake(20, 20, 280, 130);
  self.textView = [[UITextView alloc] initWithFrame: self.textViewOpenedRect];
  self.textView.contentInset = UIEdgeInsetsMake(5, 5, 5, 5);
  self.textView.delegate = self;
  self.textView.backgroundColor = [UIColor clearColor];
  self.textView.contentSize = CGSizeMake( self.textView.frame.size.height, self.textView.contentSize.height);
  
  self.textView.alwaysBounceHorizontal = NO;
  self.textView.bounces = NO;
  </code></pre>
  
  <p>UPDATE: apparently the problem is because of that line of code:</p>
  
  <pre><code>self.textView.contentInset = UIEdgeInsetsMake(5, 5, 5, 5);
  </code></pre>
  
  <p>wich I use to have a bit of space between the frame and the text. . .am I doing it properly?</p>