Lalit_vicky
Lalit_vicky

Reputation: 295

How to increase the height of UITextView when Text is more than Height

I have a UITextView and when i am entering data into that after 5-6 lines , the data is scrolling up and it cannot be seen. Is there any property that i can use to increase the height of UITextView as the text are entered more than height.

Pls suggest guys.

Upvotes: 3

Views: 1280

Answers (1)

Nikos M.
Nikos M.

Reputation: 13783

Use this code to make the height of the UITextView be the same as the height of the content inside it.

CGRect frame = _textView.frame;
frame.size.height = _textView.contentSize.height;
_textView.frame = frame;

Upvotes: 1

Related Questions