There are many solutions for this arround issue, but non-debrecated could not be found.
I have a UILabel with UILabel mode and a fixed width, say 250. The lines are set to 0.
Here is what I tried:
UILabel *contentLabel = (UILabel*)[contentView viewWithTag:10]; CGSize size = [contentLabel.text sizeWithFont:contentLabel.font forWidth:contentLabel.frame.size.width lineBreakMode:NSLineBreakByWordWrapping]; NSLog(@"Label height is: %d", size.height);
The output of the height parameter is always 20 (so that it looks like a single line), and the text is like 30 lines.
I need this for UIScrollView purposes.
ios uilabel ios7
Jacek Kwiecień Sep 13 '13 at 10:33 2013-09-13 10:33
source share