iOS-UILabel加线

NSAttributedString *attrStr =[[NSAttributedString alloc]initWithString:[NSString stringWithFormat:@"¥%@", resultModel.originalprice]attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[UIColor lightGrayColor],
NSStrikethroughStyleAttributeName:@(NSUnderlineStyleSingle|NSUnderlinePatternSolid),
NSStrikethroughColorAttributeName:[UIColor lightGrayColor]
}
];
[self.secondPrice setAttributedText:attrStr];
原文地址:https://www.cnblogs.com/WJJ-Dream/p/5786641.html