views:

1722

answers:

5

I have several UILabels of various sizes on my Views. I want all the UILabels to have the same font size no matter how wide or tall my UILabels are. I have tried several settings in IB but nothing seems to get me that fixed font size. I am sure I am missing something simple. Can someone please clue me in?

A: 

Turn off "Adjust to fit" in the Font Size preferences of the Label Attributes. Or set label.adjustsFontSizeToFitWidth = NO;

Rob Napier
A: 

You can increase minimum size of labels in Interface Builder.

porneL
A: 

Deselect the "Adjust to fit" checkbox in the Font Size category in IB.

Marco Mustapic
A: 

In Interface Builder, select your UILabel, then click on the third tab on the inspector (View Size). Assuming size and position values are ok, you need to adjust the values in the Autosizing pane as follows: deselect every red edge, both inside and outside of the internal square. When you do this, you will see immediately the related behaviour in the right rectangle showing your UILabel object when its bounds change by resizing it. Basically, as you will notice, your UILabel dimension will stay the same. This should be enough.

You can try experimenting by yourself the effect of setting some of the edges, and observing the resulting effect.

unforgiven
All these answers are proving my point. I simply want to select all my UILabels and set a font size. IB gives me no information on my font size so adjusting the size of the box until it "looks" right is pretty stupid.
Dave
+1  A: 

I found the answer to my question. Click on the UILabel in IB and then go to the menu Font > Show Fonts (or Cmd-T). There you can see the exact font you want per UILabel.

Dave