iOS: UITextView set height equal to content height
问题 I have a UITextView with disabled scrolling and I need to set the height of the UITextView to match the height of the text content. I have tried various methods found the internet with no results. This is my code for the layout of the UITextView: -(void) viewDidLayoutSubviews { // UITextView is named jobDescrip jobDescrip.scrollEnabled = NO; [jobDescrip sizeToFit]; [jobDescrip layoutIfNeeded]; } I have also tried this code in the viewDidAppear: method. Can someone please post code for an iOS