label行间距

abel.numberOfLines=0;

   [self.view addSubview:label];

   //设置行间距

   NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];

   paragraphStyle.lineSpacing = 50;

   NSDictionary *attributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSParagraphStyleAttributeName:paragraphStyle};

   label.attributedText = [[NSAttributedString alloc]initWithString:label.text attributes:attributes];

你可能感兴趣的:(label行间距)