用一个label显示动态样式,比如一行字中的几个是红色
参考了网上例子
NSString *string = [NSStringstringWithFormat:@"请选择和 %@ 阿姨的沟通效果",nameString];
NSMutableAttributedString *attriString = [[[NSMutableAttributedStringalloc] initWithString:string] autorelease];
NSRange range;
range.location = 5;
range.length = nameString.length;
[attriString addAttributes:[NSDictionarydictionaryWithObjectsAndKeys:
(id)[UIFontsystemFontOfSize:14],(NSString *)kCTFontAttributeName,
(id)[UIColorredColor].CGColor,(NSString *)NSForegroundColorAttributeName,
nil]
range:range];
[self.auntName setAttributedText:attriString];