2016-07-08 67 views

回答

0

您可以使用NSAttributedString修改這個(SWIFT 4例):

let title:String = "Your text" 
    let textParagraph:NSMutableParagraphStyle = NSMutableParagraphStyle() 
    textParagraph.lineSpacing = 10.0 /*this sets the space BETWEEN lines to 10points */ 
    textParagraph.maximumLineHeight = 12.0/*this sets the MAXIMUM height of the lines to 12points */ 
    let attribs = [NSAttributedStringKey.paragraphStyle:textParagraph] 
    let attrString:NSAttributedString = NSAttributedString.init(string: title, attributes: attribs) 
    titleTextField.attributedStringValue = attrString