UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(DeviceWidth/4, name.frame.origin.y + name.bounds.size.height, DeviceWidth/4,(GoodCell_Height - DeviceWidth/2)/2)];
[cell addSubview:lable];
lable.font =[UIFont systemFontOfSize:13.0];
lable.textColor =[UIColor lightGrayColor];
NSString *oldPrice = @"¥599.00";
NSUInteger length = [oldPrice length];
NSMutableAttributedString *attri = [[NSMutableAttributedString alloc] initWithString:oldPrice];
[attri addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(0, length)];
[attri addAttribute:NSStrikethroughColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0, length)];
[lable setAttributedText:attri];iOS 价格会有那种 中间的横线
UILabel 属性设置
最新推荐文章于 2018-03-31 11:29:56 发布
本文介绍如何使用 UILabel 控件并设置其字体、颜色及文本样式,包括如何创建带有删除线效果的字符串。
2614

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



