Hello, I am new to iOS development/XCode/Interface Builder etc and could use some help.
I'm basically filling out a simple view. The view is just tall enough to hold some labels: 'Name' '[Name Value]' 'City' '[City Value]' etc.
I'm struggling to get them to size appropriately. I've built the view in a xib, with the Labels going across the view.
What happens is when I use the simulator, the sizes of the labels don't adjust to fit the name/city that are set programmatically. So if in IB the name value label is set to this big: [...................] and the name is short, it doesn't shrink the label like [Name], instead it looks like [Name..............]. So rather than being a fluid bar with name/value labels, it has spaces and looks bad depending on the length of the name.
A shorter name might look like this:
'Name Costanza............City New York'
A longer name might look ok because it just gets close to the set length:
'Name George Costanza City New York'
When the name is really long, it overlaps Costanza and City.
I cannot for the life of me figure out how to have these labels size to fit their text. Is there an easy way to do this?
Thanks for guidance.
I'm basically filling out a simple view. The view is just tall enough to hold some labels: 'Name' '[Name Value]' 'City' '[City Value]' etc.
I'm struggling to get them to size appropriately. I've built the view in a xib, with the Labels going across the view.
What happens is when I use the simulator, the sizes of the labels don't adjust to fit the name/city that are set programmatically. So if in IB the name value label is set to this big: [...................] and the name is short, it doesn't shrink the label like [Name], instead it looks like [Name..............]. So rather than being a fluid bar with name/value labels, it has spaces and looks bad depending on the length of the name.
A shorter name might look like this:
'Name Costanza............City New York'
A longer name might look ok because it just gets close to the set length:
'Name George Costanza City New York'
When the name is really long, it overlaps Costanza and City.
I cannot for the life of me figure out how to have these labels size to fit their text. Is there an easy way to do this?
Thanks for guidance.