NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; // 对齐方式 style.alignment = NSTextAlignmentJustified; // 首行缩进 style.firstLineHeadIndent = 12.0f; // 头部缩进 style.headIndent = 12.0f; // 尾部缩进 style.tailIndent = -12.0f; NSAttributedString *attrText = [[NSAttributedString alloc] initWithString:title attributes:@{ NSParagraphStyleAttributeName : style}]; UILabel *label = [[UILabel alloc] initWithFrame:someFrame]; label.numberOfLines = 0; label.attributedText = attrText;
本文标题:label 内容首行缩进
本文链接:https://www.haomeiwen.com/subject/znaotdtx.html
网友评论