Tuesday, April 5, 2011

UITextView - set width - allow scrolling up and down - wrap text to width.

Basically I want to have a UITextView - I want it to scroll up and down (ie: I set a height and width, and if the text overflows this then the contentSize is bigger than the frame).

But, I don't want it to get wider. At the moment its scrolling left-to-right. All I want is for it to scroll up and down.

Any ideas?

Thanks Tom

From stackoverflow
  • Since UITextField inherits from UIScrollView, you should be able to do something like this:

    myTextField.contentSize = CGSizeMake(320,500);
    

    This will prevent side scrolling.

0 comments:

Post a Comment