有没有办法在 UILabel
中设置两条线的距离?
我试图在 Interface Builder 中完成它但没有成功。
最佳答案
你想要的代码应该是这样的:
NSMutableAttributedString* attrString = [[NSMutableAttributedString alloc] initWithString:@"Sample text"];
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
[style setLineSpacing:24];
[attrString addAttribute:NSParagraphStyleAttributeName
value:style
range:NSMakeRange(0, strLength)];
uiLabel.attributedText = attrString;
关于objective-c - Objective C 标签行间距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43498344/