Set UILabel line spacing

后端 未结 10 1543
鱼传尺愫
鱼传尺愫 2020-11-27 10:47

How can I modify the gap between lines (line spacing) in a multiline UILabel?

10条回答
  •  温柔的废话
    2020-11-27 11:09

    Best thing I found is: https://github.com/mattt/TTTAttributedLabel

    It's a UILabel subclass so you can just drop it in, and then to change the line height:

    myLabel.lineHeightMultiple = 0.85;
    myLabel.leading = 2;
    

提交回复
热议问题