//设置行间距? 5.0f
? ? NSMutableAttributedString * attributedString = [[NSMutableAttributedStringalloc] initWithString:self.tipLab.text];
? ? NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStylealloc] init];
? ? [paragraphStyle setLineSpacing:5.0f];
? ? [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [self.tipLab.text length])];
? ? [self.tipLab setAttributedText:attributedString];
? ? [self.tipLabsizeToFit];
时间: 2024-09-29 05:08:04