label 宽度固定 高度动态

UILabel *contentLab = (UILabel *)[suizhenView viewWithTag:702];    contentLab.numberOfLines = 0;    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:contentLab.text];     NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];     [paragraphStyle setLineSpacing:8];//调整行间距    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [contentLab.text length])];    contentLab.attributedText = attributedString;    [contentLab sizeToFit];

你可能感兴趣的:(label 宽度固定 高度动态)