UILabel添加中划线、下划线

 

 

代码添加UILable中划线和下划线。

 1     //中划线
 2     
 3     NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
 4     NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:@"内容" attributes:attribtDic];
 5     label.attributedText = attribtStr;
 6     
 7     //下划线
 8     
 9     NSDictionary *attribtDic = @{NSUnderlineStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
10     NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:@"内容" attributes:attribtDic];
11     label.attributedText = attribtStr;

 

posted @ 2016-09-02 17:43  战神在路上  阅读(5446)  评论(0编辑  收藏  举报