2014-10-11 10 views

Antwort

3

Sie das Dokument via Code Bestehen der Titel-String mit einigen leeren Abstand ("E xample") oder mit einem Tabulator (\ t) oder über Code wie folgt einstellen:

let attributedString = NSMutableAttributedString(string: "Example") 
attributedString.addAttribute(NSKernAttributeName, value: CGFloat(1.4), range: NSRange(location: 0, length: 9)) 

Dann ordnen Sie attributedString zu Ihrem Titel.

+2

diese nicht mit Xcode 8.3, Swift 3.1 für mich arbeiten –

1

der Balg Funktion funktioniert für mich, hoffe das hilft dir auch

func setCharacterSpacig(string:String) -> NSMutableAttributedString { 

    let attributedStr = NSMutableAttributedString(string: string) 
    attributedStr.addAttribute(NSKernAttributeName, value: 1.25, range: NSMakeRange(0, attributedStr.length)) 
    return attributedStr 
} 
Verwandte Themen