Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Line spacing attribute on NSMutableAttributedString

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

like image 322
Mann Avatar asked Aug 08 '13 13:08

Mann


1 Answers

You need to set paragraphStyle.maximumLineHeight.

I hope it will help!

like image 141
user2545330 Avatar answered Sep 18 '22 21:09

user2545330