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

Glib GIOChannel -

jsp - java.sql.SQLException: [Microsoft][ODBC Microsoft Access > Driver] Too few parameters. Expected 1 -

delphi - When I encode/decode SMS PDU (GSM 7 Bit) user data, do I need prepend the UDH first? -