I need to do some special alignment with a UILabel.
I want it to have 1 to 3 lines, whatever content it has.
Currently I’m doing it something like this:
label.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:14.0f];
label.backgroundColor = [UIColor clearColor];
label.numberOfLines = 0;
label.lineBreakMode = UILineBreakModeWordWrap;
label.frame = CGRectMake(114.0f, 88.0f, 187.0f, 0.0f);
[label sizeToFit];
which works great if the text is not too long. if the string is something like @"Hello World" the UILabel is only 14 points high, if it is some way longer it expands.
Now I want that the text should add it’s default ... triple dots if the text gets too long for three lines, but with the setting on top it expands to the fourth line.
How do I achieve this?
1 Answer