10

How can we set line spacing or line height on NSMutableAttributedString. I have tried with

NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setLineSpacing:150] ;
paragraphStyle.minimumLineHeight = 150;
[self addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, self.length)];

with No luck.

any suggestion would be much appreciated.

Thanks

Mann
  • 5,477
  • 6
  • 45
  • 57

1 Answers1

5

You need to set paragraphStyle.maximumLineHeight.

I hope it will help!

user2545330
  • 408
  • 4
  • 17
  • 1
    I think you have to do this on a whole paragraph (Return before and after). If you do this on text in the middle of a paragraph, it won't work... – daivuk Dec 16 '13 at 18:53