0

I have some labels in my app that displays the questions in my quiz-game! Some questions are alot longer than others, and they does not fit in the label(they get cut in the end and ends with...) How do I make them fit in the label(with smaller letters) without changing the size of the letters in the shorter questions?

Mangy92
  • 621
  • 1
  • 10
  • 25
  • I think this will help you: http://stackoverflow.com/questions/4865458/dynamically-changing-font-size-uilabel – user387184 Sep 01 '12 at 14:44

1 Answers1

1

Just check length of your question, if length is fine then do nothing and if length will increase then change font size.

or you can use this according to your label height and width.

CGSize constraint = CGSizeMake(132, 2000.0f);
CGSize size = [text sizeWithFont: [UIFont fontWithName:@"Verdana" size:13]
               constrainedToSize:constraint
                   lineBreakMode:UILineBreakModeWordWrap];
Rajneesh071
  • 30,846
  • 15
  • 61
  • 74