UILabel

    
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:8];//调整行间距
    self.label.attributedText =[[NSAttributedString alloc] initWithString: self.content
                                                               attributes:@{NSFontAttributeName:
                                                                                [UIFont systemFontOfSize:ZHB14SecondFontSize],
//                                                                            NSKernAttributeName:@3.0f,//调整字与字间距
                                                                            NSParagraphStyleAttributeName:paragraphStyle}];
    
    






    NSRange smallRange = [label.text rangeOfString:@"万" options:NSLiteralSearch];
    if (smallRange.location != NSNotFound) {
        NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:label.text];
        NSRange bigRange = NSMakeRange(0, label.text.length-1);
        [attributedText setAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:ZHB16FontSize]}
                                range:bigRange];
        
        label.attributedText = attributedText;
    }

 

posted @ 2016-11-25 10:10  TianXiang.Liu  阅读(125)  评论(0编辑  收藏  举报