美文网首页
富文本名称

富文本名称

作者: _源计划 | 来源:发表于2017-05-05 16:39 被阅读10次

2.常见的属性及说明

NSFontAttributeName字体

NSParagraphStyleAttributeName段落格式

NSForegroundColorAttributeName字体颜色

NSBackgroundColorAttributeName背景颜色

NSStrikethroughStyleAttributeName删除线格式

NSUnderlineStyleAttributeName下划线格式

UILabel*underlineLabel = [[UILabelalloc] initWithFrame:(CGRectMake(10,10,50,30))];NSString*textStr = [NSStringstringWithFormat:@"%@元", primeCost];// 下划线NSDictionary*attribtDic = @{NSUnderlineStyleAttributeName: [NSNumbernumberWithInteger:NSUnderlineStyleSingle]};NSMutableAttributedString*attribtStr = [[NSMutableAttributedStringalloc]initWithString:textStr attributes:attribtDic];//赋值underlineLabel.attributedText= attribtStr;  [self.viewaddSubview:underlineLabel];

NSStrokeColorAttributeName删除线颜色

NSStrokeWidthAttributeName删除线宽度

NSShadowAttributeName阴影

相关文章

网友评论

      本文标题:富文本名称

      本文链接:https://www.haomeiwen.com/subject/jwlstxtx.html