I have a bar with two UILabels:
[LeftMsg RightMsg]
The rules I want to set are:
RightMsg
is always fully visible, right-aligned and takes the room it needs.LeftMsg
is left-aligned and takes the remaining room.
For example, if LeftMsg
reads "This very long message does not fit the bar"
, it must be displayed as follows:
[The very long message does n... RightMsg]
I set horizontal auto-layout constrants as follows:
LeftMsg.leading = Superview.leading
RightMsg.trailing = Superview.trailing
LeftMsg.trailing <= RightMsg.leading
(If I use equality in the last constraint, XCode tells that there is a content priority ambiguity).
Now it works as follows:
[The very long message does not fit the...]
that is not what I need.
Can anyone suggest how do I correctly set constraints to achieve what I need?