Search code examples
iosswiftnslayoutconstraint

Labels not adjusting distance automatically


I have a view which looks like so...

enter image description here

Now I want the label with the character # to maintain a same distance between any text in the label with the text "N/A"

i.e it should be shown as..

enter image description here

But now it is shown like so...

enter image description here

The constraints for the label with "N/A" is shown as...

enter image description here

And the constraints for the label with # is this...

enter image description here

What are the correct constraints that I should give so that there will be a proper distance always between "#" and "N/A"..?


Solution

  • Just remove width constraint from "N/A" label and you're good to go.

    enter image description here