UILabel划线的方法(下划线,删除线)

Label/String 字符串中间加一条横线

![Upload 屏幕快照 2016-02-29 下午9.49.52.png failed. P


屏幕快照 2016-02-29 下午9.49.52.png

lease try again.]

先要Label..attributedText执行赋值

NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
    NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString: @"中划线" attributes:attribtDic];
    _lable1.attributedText = attribtStr;

Label/String 字符串中间加下划线

SDictionary *attribtDic2 = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
    
    
    
    NSMutableAttributedString *attribtStr2 = [[NSMutableAttributedString alloc]initWithString:@"下划线" attributes:attribtDic2];
    
    _lable2.attributedText = attribtStr2;

你可能感兴趣的:(UILabel划线的方法(下划线,删除线))