I have been trying to achieve this design for like 3 days but everything I tried failed.
Here's how my layout is.
- The blue part is a UIScrollView with 0 0 0 0 constraints to the main view.
- Nested inside the UIScrollView is a UIView that has all my content, also with 0 0 0 0 constraints to the UIScrollView. I also made the UIView's width equal to the UIScrollView's width.
- I then added elements from top to down. The image was simple, 10 to the top margin of the content view and fixed width and height and centered horizontally in container.
- The profile name label same as the image but with fixed height only.
- The UIView that contains the 3 labels and 2 dynamic height labels. I gave that UIView top, left and right constraints and left the bottom so that the dynamic height labels would be able to push the view's height when needed. The UILabels have 0 lines set.
- 2nd UIView, 0 0 0 0 and 5 5 5 5 constraints for each label inside
- UITableView inside a UIView, the view has a fixed height and the table is 0 0 0 0 as well.
- The button 5 top, 5 left, 5 right. I then made the container UIView (which contains all those items) to have an alignment with the button's bottom edge as seen in this post's top answer: UIView with dynamic height multiple UILabel.
I also used this video as a reference on how to implement a UIScrollView since this was my first time ever. https://www.youtube.com/watch?v=VE6DQGy4iS8
I'm not allowed to use UIStackView bec we're targeting iOS 8.
The 2 obvious issues I have right now are: