7

I have a custom UITableViewCell that has the following elements:

  • UIImageView
  • UILabel
  • UILabel

I want the UIImageView on the left, and the 2 UILabel objects stacked one on the other on the right side. Here's what it looks like in the storyboard:

StackView

I've got a horizontal UIStackView. Inside it is the UIImageView and a vertical UIStackView.

Here's what the hierarchy looks like:

hiearchy

For some reason, I'm getting warnings on ambiguity for the title and description labels. I've tried to tweak them again and again but I couldn't get it quite right. Any advice is appreciated.

Kelvin Lau
  • 6,373
  • 6
  • 34
  • 57

1 Answers1

4

Make the vertical stackview as fill equally

What I would do is to fix aspect ratio or size of image and make horizontal stack view as equally fill

If image size is variable then I would set the content hugging priority of image higher to the vertical stack view so that it displays entire image without cropping and vertical stack view with fill equally.

ahmed
  • 540
  • 2
  • 18