LineBreakMode的错误
你能解释一下为什么NSLineBreakByWordWrapping有时不起作用吗?
它是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]}]];
是! ;)
我得到这行格式:
U041f U0438 U0440 U043e U0436 U043d U044b U0435 U00a0Laduree U00a0 U00ab U043e U0434 U0435 U0442 U044b U0435 U00bb U0432 U00a0Emilio Pucci
其中 U00a0是错误的空格(NO-BREAK SPACE),我编码此行并将错误的空格替换为正常空格
链接地址: http://www.djcxy.com/p/81949.html下一篇: UILabel highlighted color attributed string (Apple bug?)