I have a view which has on top a UITextView
then a series of other views. The idea is to resize the Text View on its content size and to move up all the other views.
I have set all the constraints in storyboard and if I change the height constraint value of my TextView from there, all the view updates fine.
On runtime I can resize the Text View frame to fit it's content size, but the rest of the view doesn't change. So I'm guessing I don't have to change the frame but only the height constraint.
Any suggestion on how is it possible to do this thing on runtime? How can I change the Height constraint value in code? Is there any way to "link" a constraint to the controller from storyboard?
Thanks for helping
Make an IBOutlet of height contraint from nib to your .h file.
Lets name it textViewHeightConstraint
self.textViewHeightConstraint.constant = textView.contentSize.height
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