ibireme / YYText

Powerful text framework for iOS to display and edit rich text.
MIT License
8.86k stars 1.7k forks source link

给YYLabel设置yy_backgroundColor,没有起作用 #132

Closed zingwin closed 8 years ago

zingwin commented 8 years ago
NSMutableAttributedString* contentAttributed = [[NSMutableAttributedString alloc] initWithString:@"default stringas"];
contentAttributed.yy_font = [UIFont systemFontOfSize:16];
contentAttributed.yy_color = [UIColor blackColor];
contentAttributed.yy_alignment = NSTextAlignmentLeft;
contentAttributed.yy_lineBreakMode = NSLineBreakByCharWrapping;
contentAttributed.yy_backgroundColor = [UIColor yellowColor];

yyLabel.attributedText = contentAttributed;

ibireme commented 8 years ago

yy_backgroundColor 只能用于 UILabel/UITextView,这个属性的注释上有标注。 背景色可以用 yy_textBackgroundBorder 来设置。

zingwin commented 8 years ago

谢谢。