美文网首页 ios零碎记录
IOS 设置label中划线、下划线

IOS 设置label中划线、下划线

作者: 大强哥 | 来源:发表于2016-03-24 15:49 被阅读526次

IOS 设置label中划线

    NSDictionary *dic = @{NSStrikethroughStyleAttributeName:[NSNumber numberWithInteger:NSUnderlineStyleSingle],
                          NSFontAttributeName:KSYSTEM_FONT_12,
                          NSForegroundColorAttributeName:KCOLOR_GRAY_LIGHT};
    NSString *str = [NSString stringWithFormat:@"¥%.2f",[list.marketPrice floatValue]];
    NSMutableAttributedString *oldPriceAtt = [[NSMutableAttributedString alloc] initWithString:str attributes:dic];

IOS 设置label下划线

    NSDictionary *dic = @{NSUnderlineStyleAttributeName:[NSNumber numberWithInteger:NSUnderlineStyleSingle]};
    NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:@"123" attributes:dic];

相关文章

网友评论

    本文标题:IOS 设置label中划线、下划线

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