//显示下划线
//中划线
// NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
//下划线
NSDictionary *attribtDic = @{NSUnderlineStyleAttributeName: [NSNumbernumberWithInteger:NSUnderlineStyleSingle]};
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:oldStrattributes:attribtDic];
oldPriceLabel.attributedText = attribtStr;
//显示下划线
//中划线
// NSDictionary *attribtDic =
@{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
//下划线
NSDictionary *attribtDic =
@{NSUnderlineStyleAttributeName: [NSNumbernumberWithInteger:NSUnderlineStyleSingle]};
NSMutableAttributedString *attribtStr =
[[NSMutableAttributedString alloc]initWithString:oldStrattributes:attribtDic];
oldPriceLabel.attributedText = attribtStr;
本文介绍如何使用Objective-C在iOS应用中为UILabel的文本添加下划线效果。通过创建NSAttributedString并设置NSAttributedStringKey属性来实现这一目标。
3598

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



