Open luoshiyutim opened 5 years ago
这个行间距就可以了NSMutableAttributedString 的 lineSpacing `let text = NSMutableAttributedString() text.alignment = .left text.lineBreakMode = .byWordWrapping
let successRate = (persionInfoModel?.successRate ?? "99%")
let titleStr = "接通率: " + successRate
let titleText = NSMutableAttributedString(string: titleStr)
titleText.font = MainFont.bold.with(size: 16)
titleText.color = UIColor.kColor333
titleText.lineSpacing = 12
titleText.alignment = .left
titleText.lineBreakMode = .byWordWrapping
text.append(titleText)`
如图,行距会根据每行之间不同的字体大小而产生不同,请问如何让行距相同呢?![image](https://user-images.githubusercontent.com/17313127/55849636-fb82af80-5b83-11e9-8338-ad91881778f7.png)