I'm trying to get a UITextView to dynamically size it's self to it's content. Sometimes the height of the text view will be 100 sometimes 700.
Everything I've tried so far hasn't worked.
I've tried the following in viewDidLoad
and also in viewDidLayoutSubviews
.
here's the code:
CGRect frameDesc = self.descriptionDeal.frame;
frameDesc.size.height = self.descriptionDeal.contentSize.height;
self.descriptionDeal.frame = frameDesc;
self.descriptionDeal.backgroundColor = [UIColor redColor];
I added the background color so I could see the size of the view and it's not sizing to content.
I also tried:
[self.descriptionDeal sizeToFit];
Also, not sure if it's affecting anything, but in the story where the UITextView is laid out the size is set there. I thought the code above would override it, but somethings not working correctly.
thanks for any help