0

I'm trying to create a horizontal stackview inside of a table view cell that displays information that is separated by dividers. Essentially, I want my stackview to end up looking like the solution here: Create Vertical lines between Uilabels inside of a stack view.

enter image description here

However, mine ends up looking like this:

enter image description here

I'm having trouble making the padding of post and members more even. Also, how can I make the divider lines shorter like depicted in the solution provided above.

thanks in advance.

matt
  • 515,959
  • 87
  • 875
  • 1,141

1 Answers1

1

Play around with the stack view's distribution setting; "fill equally" should give you something closer to what you want.

The divider line height depends on the height of the stack view (which in turn depends on the cell height, as specified in tableView(_:heightForRowAt:)), so either make the stack view smaller or nest your dividers in a bigger view, setting a certain distance from the edges.

juliand665
  • 2,664
  • 1
  • 16
  • 16