关于UIlabel 换行时,出现明明上一行还可以显示单词,但是却直接跟后面的单词换行显示。
处理方案:使用富文本显示,并添加设置要求。
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
NSDictionary *attributes = @{NSParagraphStyleAttributeName:paragraphStyle};
UIlable *notesLabel = [[UILabel alloc]init];
notesLabel.numberOfLines = 0;
notesLabel.attributedText = [[NSAttributedString alloc] initWithString:@“showContext” attributes:attributes];
原文:https://www.cnblogs.com/GUANGANJIUQI/p/iOS.html