您的位置:首页 > 其它

NSMutableAttributedString 属性字符串的使用

2015-07-29 22:13 323 查看
NSString *priceString = [NSString
stringWithFormat:@"¥%.2f ",model.curprice.doubleValue];

NSMutableAttributedString *attrPriceString = [[NSMutableAttributedString
alloc]
initWithString:priceString
attributes:@{NSForegroundColorAttributeName:RGB(253,
126,
49),NSFontAttributeName:[UIFont
systemFontOfSize:14],NSStrikethroughStyleAttributeName:@(NSUnderlineStyleNone)}];

[attrPriceString addAttributes:@{NSFontAttributeName:[UIFont
systemFontOfSize:10]}
range:NSMakeRange(0,
1)];

self.priceLabel.attributedText = attrPriceString;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: