Reputation: 378
I have this navigation bar. In the bar I have a random name, it won't always be the same. However, as it is now a big space comes between the 2 labels.
My guess would be to use some kind of constraints, but Im kinda new to xcode so Im not sure which.
Upvotes: 0
Views: 391
Reputation: 285
I have used the following constraints :
Select both the labels and set their constraints equal height and align them to vertical center.
Select the first label align its vertical center to the navigation bar and give its leading constraint (as much space you want) and keep its trailing space to 0 (I have given trailing space as 5 to keep some space between the texts of both labels)with the second label.
Your xcode will give warning for the trailing constraint of the second label. You must keep it as >= (greater than or equal) to the super view by giving your desired constant.
For the first Label i.e. Jonas You constraints will look like this
Keep the text alignment of the second label to left
Upvotes: 1