Hello,
I'm using sizeWithFont:constrainedToSize:lineBreakMode: to calculate the actual height of a UILabel. However, the height I get is always based on the complete NSString (before it gets truncated).
In fact, both sizeWithFont:constrainedToSize:lineBreakMode: and sizeWithFont:constrainedToSize: produce identical results as if the UILineBreakModeTailTruncation gets ignored!
This code produces 60.000000 no matter what I try, but the first result should be less than 60. Any idea why?
CGSize aSize;
aSize=[@"One two three four five six seven eight nine ten" sizeWithFont:[UIFont boldSystemFontOfSize:12] constrainedToSize:CGSizeMake(100, 100)];
NSLog(@"aSize.height: %f",aSize.height); //returns 60.000000
aSize=[@"One two three four five six seven eight nine ten" sizeWithFont:[UIFont boldSystemFontOfSize:12] constrainedToSize:CGSizeMake(100, 100) lineBreakMode:UILineBreakModeTailTruncation];
NSLog(@"aSize.height: %f",aSize.height); //returns 60.000000
Thank you.