标签:
#import <UIKit/UIKit.h> //价格 NSString *priceStr = @"99元 剁手价66元"; NSMutableAttributedString *priceString = [[NSMutableAttributedString alloc] initWithString:priceStr]; [priceString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0f] range:NSMakeRange(0, 3)]; [priceString addAttribute:NSStrikethroughStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, 3)]; [priceString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0f] range:NSMakeRange(4, 5)]; [priceString addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithNumber:110] range:NSMakeRange(4, 5)]; priceLabel.attributedText = priceString;
NSMutableAttributedString 富文本删除线的用法
标签:
原文地址:http://www.cnblogs.com/lear/p/4648477.html