简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM