self.title = @"shi jia n d timer";
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"Using NSAttributed String"];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor blueColor] range:NSMakeRange(0,5)];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(6,12)];
[str addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(19,6)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Arial-BoldItalicMT" size:30.0] range:NSMakeRange(0, 5)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:30.0] range:NSMakeRange(6, 12)];
[str addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Courier-BoldOblique" size:30.0] range:NSMakeRange(19, 6)];
attrLabel.attributedText = str;
//不确定字符串的大小,两部分的内容不同的设置
//用空格将label的内容分割成两部分
label.text = @"222.0 元";
//设置label上不同的颜色
NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:label.text];
NSRange redRange = NSMakeRange(0, [[noteStr string] rangeOfString:@" "].location);
//设置字体颜色
[noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithFourTwoButtonColor] range:redRange];
[noteStr addAttribute:NSFontAttributeName value:cwFont(15) range:redRange];
[label setAttributedText:noteStr] ;