swift字体间距调整

view.textLabel.lineBreakMode = .byWordWrapping
        view.textLabel.sizeToFit()
        let str_ss = "2.此服务包含挂号业务,您选择的就诊时间仅为参考具体就诊时间会根据具体挂号时间变化,具体时间陪诊员会通知您,请你保持手机畅通或注意app消息通知。3.如果您不需要挂号请通过app告知陪诊人员,费用不做任何改变,请您悉知。"
        let attributedString:NSMutableAttributedString = NSMutableAttributedString(string: str_ss)

        let paragraphStyle:NSMutableParagraphStyle = NSMutableParagraphStyle()

        paragraphStyle.lineSpacing = 7 //大小调整

        attributedString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, str_ss.count))
        view.textLabel.attributedText = attributedString

推荐阅读更多精彩内容