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 programmati
With custom insets i found the best solution for me is to subclass the UITextView and then in the layoutSubviews call the following code.
-(void) layoutSubviews
{
// always keep content offset at x = 0
self.contentOffset = CGPointMake(0, self.contentOffset.y );
[super layoutSubviews];
}
Hope this helps someone.