最佳答案
我找到了您问题的解决方案。它非常简单易懂。
NSMutableAttributedString *mutableAttributeStr = [[NSMutableAttributedString alloc]initWithString:@"User this is just a comment.This just a comment.This just a comment."];
NSAttributedString *attributeStr = [[NSAttributedString alloc]initWithString:@"\n" attributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:8]}];
[mutableAttributeStr addAttribute:NSFontAttributeName value: [UIFont fontWithName:@"Helvetica-Bold" size:14.0] range:NSMakeRange(0, 4)];
[mutableAttributeStr appendAttributedString:attributeStr];
labelTextBelowAnotherLabel.numberOfLines = 0;
[labelTextBelowAnotherLabel setAttributedText:mutableAttributeStr];
上面的编码中我设置了 helvetica 粗体和字体大小供引用。如果您想更改为 systemBold,只需更改并根据您的要求设置字体大小即可。
谢谢-:)
关于ios - 如何在 iOS 中在其他标签下方显示两个单标签文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33073363/