chetu
chetu

Reputation: 245

How can I create a UITextView that expands vertically as required?

I am trying to create an iphone application where I need an expandable UITextView. I am looking for something similar to a feature in contacts app for adding notes.

Upvotes: 0

Views: 1297

Answers (1)

Anomie
Anomie

Reputation: 94794

UITextView is a subclass of UIScrollView, so it should work to use the contentSize property to find out the dimensions of the content and resize the view accordingly. To properly react as the user edits, you should be able to use the delegate's textViewDidChange: method to trigger the size update.

Upvotes: 2

Related Questions