bug with LineBreakMode

Can you explain me why NSLineBreakByWordWrapping sometimes not working?

It's tableView

NSMutableParagraphStyle *paragrahStyle = [[NSMutableParagraphStyle alloc] init];
[paragrahStyle setLineSpacing:4];
paragrahStyle.lineBreakMode = NSLineBreakByWordWrapping; //Char

[[cell titleLabel] setAttributedText:[[NSAttributedString alloc] initWithString:((Post *)posts[indexPath.section])->title attributes:@{NSParagraphStyleAttributeName : paragrahStyle, NSFontAttributeName : [UIFont fontWithName:@"Roboto-Condensed" size:24.0f]}]];

在这里输入图像描述


YES! ;)

I get this line in format:

U041fU0438U0440U043eU0436U043dU044bU0435U00a0LadureeU00a0U00abU043eU0434U0435U0442U044bU0435U00bb U0432U00a0Emilio Pucci

where U00a0 is wrong spaces (NO-BREAK SPACE), i encode this line and replace wrong spaces to normal spaces

链接地址: http://www.djcxy.com/p/81950.html

上一篇: NSLayoutManager characterIndexForPoint方法在ios9上失败

下一篇: LineBreakMode的错误