Monthly Archives: April 2014

Making UITextView’s size exactly fit its content on iOS7

Sometimes you might want to add a UITextView as a subview to your layout, give it a specific width, assign some textual content to it and then make the text view exactly so high that it won’t scroll.

Back in the good old days of iOS6 one would just set the Frame size to the ContentSize of the UITextView. Done. But this does not work any longer on iOS7.

Making UITextView’s size exactly fit its content on iOS7

Sometimes you might want to add a UITextView as a subview to your layout, give it a specific width, assign some textual content to it and then make the text view exactly so high that it won’t scroll.

Back in the good old days of iOS6 one would just set the Frame size to the ContentSize of the UITextView. Done. But this does not work any longer on iOS7.