我在单元格中有一个UILabel,我在其中设置了属性文本。它归因于文字太大而不应该......最后。怎么做?
答案 0 :(得分:1)
func addTitle(title: String) {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineBreakMode = .byTruncatingTail
let attributedTitle = NSAttributedString(string: title, attributes: [NSParagraphStyleAttributeName: paragraphStyle])
self.titleLabel.attributtedString = attributedTitle
}