//显示下划线
//中划线
// NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
//下划线
NSDictionary *attribtDic = @{NSUnderlineStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:oldStr attributes:attribtDic];
oldPriceLabel.attributedText = attribtStr;
本文介绍如何使用Objective-C在iOS应用中为UILabel的文本添加下划线样式。通过创建NSAttributedString并设置相应的NSAttributedStringName属性,可以轻松地将下划线应用于UILabel中的文本。

268

被折叠的 条评论
为什么被折叠?



