I don't suppose someone could guide me on the proper way to dynamically size a UITextView while still using Auto-Layout? Using Swift, that is.
I've tried programmatically adjusting the bottom constraints in attempt to get the UITextView to hug the content. But I'm not sure how to get the height of the content of the UITextView?
I'm attempting to load data into UITextView fields, then, dynamically adjust them to look neat.
@IBOutlet weak var serviceDescriptionTextViewBottomGuide: NSLayoutConstraint!
override func viewDidLoad() {
self.activityName.text = serviceCodes[selectionValue]
self.serviceDescriptionTextView.text = serviceDescription[selectionValue]
self.whenToUseDescriptionTextView.text = whenToUseCode[selectionValue]
self.serviceDescriptionTextViewBottomGuide?.constant += x
}
Disable scrolling and do not put any other constraint that can dictate the height of UITextView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With