ios - Expand UITextView based on its content -
i'm trying expand uitextview change frame based on content.
the textview should resize height when text inside of gets larger, , smaller when user deletes text.
i tried many answers didn't work.
using following 2 lines best answer question, , solved problem:
expandingtextview.textcontainer.heighttrackstextview = true expandingtextview.isscrollenabled = false   notes:
 expandingtextview: uitextview.
 textcontainer: nstextcontainer bounds of text inside expandingtextview.
 heighttrackstextview: bool if true, reciever adjust height based on expandingtextview height.  
in order expanding work, need disable textview scrolling by:
 isscrollenabled = false
Comments
Post a Comment