在iOS6中打破了TTTAttributedLabel linebreakmode

koh*_*Xun 3 truncation nsattributedstring ios

如果我在TTTAttributedLabel示例应用程序"Espresso"中将linebreakmode设置为截断尾部,看起来它应该在iOS 5模拟器中,但如果我在iOS 6模拟器中运行应用程序,文本会在第一行后被截断,尽管文本超过3行.行数设置为零.我错过了什么?在Espresso应用程序中我注意到这种行为后,我可以不再担心我自己的应用程序中代码的破坏.有什么建议?谢谢!

dom*_*nik 9

我目前面临同样的问题.在实际设置文本之前尝试设置LineBreakMode.例如:

TTTAttributedLabel* descriptionLabel = [[TTTAttributedLabel alloc] initWithFrame:CGRectMake(20, 120, 280, expectedSize.height)];
descriptionLabel.lineBreakMode = UILineBreakModeWordWrap;
descriptionLabel.numberOfLines = 0;
descriptionLabel.text = description;
Run Code Online (Sandbox Code Playgroud)