码迷,mamicode.com
首页 > 其他好文 > 详细

UILabel 字体下方加下划线

时间:2015-12-04 18:07:53      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:

    UILabel *knowKankan = [[UILabel alloc] initWithFrame:CGRectMake(0, MAINHEIGHT - 78 , MAINWIDTH, 22)];
    knowKankan.textAlignment = NSTextAlignmentCenter;
    knowKankan.textColor = [UIColor whiteColor];
    knowKankan.font = [UIFont systemFontOfSize:16];
   
    NSMutableAttributedString *content = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"了解看看"]];
    NSRange contentRange = {0,[content length]};
    [content addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:contentRange];
   
    knowKankan.attributedText = content;
   
    [imageTwo addSubview:knowKankan]

UILabel 字体下方加下划线

标签:

原文地址:http://www.cnblogs.com/tian-sun/p/5020005.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!