有正字断字的方法吗?
像这样:
NSStiring *string = @"In June 2010 at the World Wide Developers Conference, Apple announced version 4 of Xcode during the Developer Tools State of the Union address.";
UILabel *label = [[UILabel alloc] init];
label.text = string;
如果框架 UILabel 变窄,则获取下一个:
In June 2010 at
the World Wide
Developers Con-
ference, Apple
announced ver-
sion 4 of Xcode
during the Devel-
oper Tools State
of the Union ad-
dress.
最佳答案
使用带有 hyphenationFactor
为 1 的 NSParagraphStyle 的 NSAttributedString。
关于ios - IOS 中的正字连字词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16502556/