Reputation: 121
I have a textView which loads text from my server and I am trying to make it flexable in the scroll view and if the text is long it should expand and if text is short it comes back to the size of the text
I did not tried any code because I think this is constraints issue
Upvotes: 0
Views: 391
Reputation: 168
Set the constraints of the UITextView top, left, right and remove the bottom constraint and it should work.
Tested with Xcode 12.3 , Swift 5
Upvotes: 1
Reputation: 482
According to your question, you using Autolayout. Perfect!
So if you want to fit your TextView size to its content. You should uncheck on your storyboard (of textView),
Or by code:
textView.scrollEnabled = false
p.s. be sure that you created constraints correctly in your storyboard
Upvotes: 0