I'm using CustomCell
instead of UITableViewCell
on UITableView
.
I put two UILables
on CustomCell
.
Refered this site: here , but I failed...
Question : How can I control line spacing of UILabels?
I'm using CustomCell
instead of UITableViewCell
on UITableView
.
I put two UILables
on CustomCell
.
Refered this site: here , but I failed...
Question : How can I control line spacing of UILabels?
Starting from iOS 6
you can set an attributed string to the UILabel
. Check the following :
NSMutableParagraphStyle *paragrahStyle = [[NSMutableParagraphStyle alloc] init];
[paragrahStyle setLineSpacing:40];
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragrahStyle range:NSMakeRange(0, [labelText length])];
cell.label.attributedText = attributedString;
Programmatically:
SWift 4
Using label extension
Now call extension function
Or using label instance (Just copy & execute this code to see result)
Swift 3
Just copy & execute this code to see result.
From Interface Builder: