iOS 更改UIlabel行间距

2019-03-25  本文已影响0人  孟小于max
            let paragraphStyle = NSMutableParagraphStyle()
            paragraphStyle.lineSpacing = 5//此处为设置行间距为5
            paragraphStyle.lineBreakMode = .byCharWrapping
            let attributes = [
                NSAttributedStringKey.font:UIFont.systemFont(ofSize: 13),
                NSAttributedStringKey.foregroundColor:UIColor().colorWithHexString(color: "666666"),
                NSAttributedStringKey.paragraphStyle: paragraphStyle
            ]
上一篇 下一篇

猜你喜欢

热点阅读