我发现UILabel使用设置行间距,他不再显示省略号的大小即使他不够,我想知道如何添加省略号
let message:NSString = "Perhaps you are an average student with average intelligence."
let attributedString = NSMutableAttributedString(string: str as String)
let paragraphStyle = NSMutableParagraphStyle();
paragraphStyle.lineSpacing = 5
attributedString.addAttribute(NSParagraphStyleAttributeName, value: paragraphStyle, range: NSMakeRange(0, message.length))
detailLabel.attributedText = attributedString
答案 0 :(得分:0)
你的意思是圆角?如果你想要完美的圆角添加
detailLabel.layer.cornerRadius = detailLabel.frame.height / 2