I need to place two labels and an image horizontally:
[label1]-10-[icon]-10-[label2]
the problem is that label1it has no text (i.e. empty text), then the distance between the left edge iconwill be another 10 pts.
What I'm doing now is when I set any label text, I remove all restrictions and re-add them, and the spacing depends on the text. This is clearly inefficient because the labels are in a cell that can be reused, so every time the cell is reused, the restrictions are removed and reapplied.
The next thing I want to try is to have a limited restriction only for label1and icon, therefore, every time I set the text label1, I add or remove the selected restriction.
I am also wondering if there is a better way to do this? This is normal if it fundamentally changes the way they are arranged.
thanks
source
share