I'm trying to create a dynamic UIView that holds some fixed graphics elements and some dynamic text. I can't find a tutorial, or something in documentation that works for my project. Below is my exploded view (my view with scrollView and main view's height is forced to 800 in iphone 5 view, only for the pourpose of this question)
What do I want to acheive? The Header,the image,static view and static view 2 are all fixed, and they will not change with their contents. Label 1, Label 2 and the textarea will grow with their content size.
I have worked on this thing for about a day, and I need a little help because I can't achive any results. I have tried this solution:
With this solution I can see in NSLog() the textview constraint that return a correct value
self.textViewHeightConstraint.constant = [textview sizeThatFits:CGSizeMake(textview.frame.size.width, CGFLOAT_MAX)].height;
but the textarea frame at runtime remains the same.
i have tried also this tutorial:
It works for me in a project with only a scrollview, content view and textview. When i try to use that logic in my project it doesn't work anymore.
I have tried many other solutions, so my questions are: How I can achive the desired result? Or maybe there's something ridiculously wrong in my layout setting? Or simply, is there someone that can point my to a tutorial that cover a similar view organization?