0

It's possible to make an UIView adjust automatically his height to accommodate an StackView, via Interface Builder? I' wanna put a background on a StackView, but as long it is not possible, as StackView is not renderable, I'm using it inside a UIView, but XCode is complaining about a height constraint.

Thanks a lot![enter image description here]1

Cleversou
  • 461
  • 4
  • 16

2 Answers2

0

You need to constraint top, bottom, leading, trailing of the UIView to the UIStackView, and nothing more.

Fujia
  • 1,232
  • 9
  • 14
  • Thanks for your answer bro. Actually I need the StackView to be constrained to the UIView. I have solved the problem putting a height constraint from the UIView to the height of the StackView. It worked perfectly. Thanks again! – Cleversou Jul 18 '16 at 13:41
0

Well, sometimes the answer is so obvious that we can't see it. I've just put a height constraint of the UIView to the height of the StackView and it worked like a charm!

Cleversou
  • 461
  • 4
  • 16