I have a UILabel inside a cell that contains several elements. I need the label to assign a string that can fill the height of the label, i.e. Skip multiple lines if necessary. I managed to do this, and if I launched the application on iOS7, it looks just fine (ignore the yellow background color): 
Here is the UILabel setup:
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %@", sender, content]]; NSRange selectedRange = NSMakeRange(0, sender.length);
where self.notificationText is the UILabel I'm talking about. In the xib file for the cell, I set the minimum font size to 3 and the number of lines to 0. As I said, it works fine on iOS 7, but on iOS 6 for some reason it does not know how to make the word wrapping on it own and tries to "Truncate the tail", since this is the line break mode, which was set by default in xib, as a result of which the cell looks like this: 
If I change the line break mode to Word Wrapping, it will disable the application on iOS 6, saying that:
NSAttributedString invalid for autoresizing, it must have a single spanning paragraph style (or none) with a non-wrapping lineBreakMode.
How do I get this to work on iOS 6?
ios uilabel multiline nsattributedstring
damjandd
source share