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?
Asked
Active
Viewed 1,247 times
1 Answers
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