开发者

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

开发者 https://www.devze.com 2023-01-21 20:57 出处:网络
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 c开发者_C百科ontentSize is bigger than the frame).

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 c开发者_C百科ontentSize 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


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

精彩评论

暂无评论...
验证码 换一张
取 消