A reference to the line spacing of the Uilabel is usually solved by the following method.
UILabel*label = [[UILabelAlloc]initWithFrame: Labelframe];
[LabelSetBackgroundColor:[UicolorClearcolor]];
[LabelSetTextColor: TextColor];
[LabelSetnumberoflines:0];
Label.Font=textfont;
NSString*labeltext=@ "I am content, I am content, I am content, I am content, I am content.";
Nsmutableattributedstring*attributedstring= [[NsmutableattributedstringAlloc]Initwithstring: LabelText];
Nsmutableparagraphstyle*paragraphstyle= [[NsmutableparagraphstyleAlloc]Init];
[ParagraphstyleSetlinespacing:10];//Adjust line spacing
[AttributedstringAddAttribute:Nsparagraphstyleattributename value :p Aragraphstyle :nsmakerange 0,[labeltext length])];
label. attributedtext = attributedString;
[contentview addsubview:label";
[Label SizeToFit];
This approach can be achieved if the content you want to show is fully visible in a region. But if you only show a specific two lines, or a few lines, which means you don't need to display all the contents of the label, the above method cannot be reached. Fortunately, someone wrote a ready-made label control for us to use. Tttattributedlabel: Https://github.com/mattt/TTTAttributedLabel
IOS Uilabel Text line spacing