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:
How to stop the horizontal scrolling programmatically?
and it is not working. Any hints?
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;
UPDATE: apparently the problem is because of that line of code:
self.textView.contentInset = UIEdgeInsetsMake(5, 5, 5, 5);
wich I use to have a bit of space between the frame and the text. . .am I doing it properly?