iphone - resizing text in UITextView -


how resize text in uitextview doesn't cut off text? have uitextview set @ specific height , want text in uitextview fit in height. in uitextfield have adjustsizetowidth, not in uitextview

cgrect frame = textview.frame; frame.size.height = textview.contentsize.height; textview.frame = frame; 

source: https://stackoverflow.com/a/2487402/253008

edit:

you can use

-(cgsize)sizewithfont:(uifont *)font constrainedtosize:(cgsize)size 

to check width of text in uitextview , when reaches set width can start lowering font size


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -