Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Saif Tase
Saif Tase
24,578 Points

Resize Height of UITextView Based on Content

How does one change the height of a UITextView's frame depending on the text that is currently being displayed by the text view? I have tried a ton of suggested solutions and looked around quite a bit for help, but can't seem to find anything that works.

1 Answer

Robert Bojor
PLUS
Robert Bojor
Courses Plus Student 29,439 Points

Here's a simple method that seems that it will work, but you have to note that it will not if AutoLayout is on...

http://stackoverflow.com/questions/50467/how-do-i-size-a-uitextview-to-its-content