一个UILabel设置多个文字颜色

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"我是中国人我爱中国"]; [str addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(5, 3)];
相关文章
相关标签/搜索