label标题文字改变颜色

NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:@"输入一段话,123改变颜色"];
NSRange redRange = NSMakeRange([[noteStr string] rangeOfString:@"123"].location, [[noteStr string] rangeOfString:@"123"].length);
[noteStr addAttribute:NSForegroundColorAttributeName value:colorWithRGBA(89, 212, 234, 1) range:redRange];
[Label setAttributedText:noteStr];

你可能感兴趣的:(iOS,iOS,label,改变颜色)