I want to create a UITableViewCell
with many UIViews
, vertically stacked. Some of those UIViews
are more complex, with many subviews inside for example.
I tried to create one for example. The first subview is a header view with a label horizontally centered with an unknown number of lines, and the other contains an image view on the left and a view with a label inside on its right (like a cell in a messager view). Straight from IB :
The header view and the descending constraints for the header label:
The bottom view:
The avatar image view:
The subview with the message label constraints inside:
However some things are still missing:
What am I missing here? Thanks for your help.
You want vertically stacked views, so you should use StackView and set the axis property to vertical.
If all views have the same size, then set your distribution to fill equally, otherwise fill proportionally.
https://www.raywenderlich.com/508-uistackview-tutorial-introducing-stack-views