label调整字间距,调整行间距

number = 1.0f
 
//调整字间距
     CFNumberRef num = CFNumberCreate(kCFAllocatorDefault,kCFNumberSInt 8 Type,&number;);
     [attributedString addAttribute :( id )kCTKernAttributeName value :(__bridge id )num range :NSMakeRange( 0 , [attributedString length ])];
     //调整行间距
     [attributedString addAttribute : NSParagraphStyleAttributeName value :paragraphStyle range :NSMakeRange( 0 , [_messageLabel .text length ])];

    _messageLabel.attributedText = attributedString;

你可能感兴趣的:(label)