iOS中设置同一文本的不同颜色值

 NSMutableAttributedString *text = [[NSMutableAttributedString alloc]initWithString:self.label.text];    //将所要设置的文字设置取出

 [text addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(0, 1)];  //设置所取出文字的特点,然后设置其值

posted @ 2015-08-24 15:27  风灵子偌  阅读(195)  评论(0编辑  收藏  举报