UITextView Auto Height [duplicate]
How do I make a UITextView expand or shrink to the size of the text inside it and then make the UIScrollview Expand or shrink to fit the UITextView
CGRect frame;
frame = textiew.frame;
frame.size.height = [textView contentSize].height;
textView.frame = frame;
One thing to note is that the correct contentSize is only available after the UITextView has been added to the view with addSubview and the text is assigned to it. Prior to that it is equal to frame.size
精彩评论