Set UIView size to fit subViews

后端 未结 2 1566
难免孤独
难免孤独 2020-12-31 03:31

I\'m having a UIView that\'s containing two UILabels, which have dynamic heights. I want the UIView to fit the size of the UILabels + some padding.

2条回答
  •  孤独总比滥情好
    2020-12-31 03:59

    You can do it using the storyboard itself.

    Set the View's bottom constraint to second UIlabel. So when the height of label increases, UIView's height will also increases.

提交回复
热议问题