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];

 

posted @ 2016-08-19 10:30  J-Vijay  阅读(258)  评论(0编辑  收藏  举报