I am trying to achieve a view I mocked out on sketch. I\'ve replicated it on Android cause I\'m really good on that platform. I\'m good on iOS, but the UI is kind of my weak poi
From your screenshots it seems that you have a problem with the auto layout system and dynamic cell. For this is suggest to read this very good answer on stack overflow that explain how to build dynamic cells with auto layout. An important thing to consider is that creating views with auto layout is very fast and intuitive but it expensive from a performance point of view. This problem is accentuated for the UITableView
where the scroll can result not smoothly. If you have simple cell (only few views and a view hierarchy with few levels) it can be ok but to the auto layout manager I suggest to:
estimatedRowHeight
if all the cells have the same heighttableView(_:estimatedHeightForRowAtIndexPath:)
of the UITableViewDelegate
if the cells have different heights.Regarding the problem with margins I suggest to nest a UIView
inside the contentView
of the cell and use it as container for all the other views of the cell. In this way you can add left and right margins between this view container and the contentView
so that you can center it.