user1682759
user1682759

Reputation: 89

Autolayout constraint priorities

I have UItableViewCell Custom cell as shown in attached screenshot. I have created xib cell using Autolayout. But I am not able to 1.set proper space between labels 2.set Height Priorities for labels 3.set Content Vertical and compression resistance priorities for labels.

Labels should be multiline as well as have equal distance between them. Sometimes label may not have text.Data is dynamic.

Please help me in setting autolayout constraint priorities.

enter image description here

Upvotes: 2

Views: 191

Answers (1)

Thanveer Ahammed
Thanveer Ahammed

Reputation: 148

You need to set a height and width constraints for uiimageview first. 2. put top and left pin by 8 points. 3.set lines are "0" for each labels . 4.add leading space and trailing space (8 points each) for 1st label.and also top align to uiimageview. 5.add top space for 2nd label (8 points) to 1st label.and also leading space and trailing space (8 points). 6.add top space for 3rd label to 2nd label and align leading & trailing space to 2nd label. 7.add bottom space for the 3rd label.

these are the constraints needed for this.

Upvotes: 1

Related Questions