Vote count:
0
I want to setup a attributed title for WKInterfaceButton in swift. I already search and tried and here is my code:
var boldFont = UIFont(name: "Verdana-Italic", size: 15.0)!
var greenColor = UIColor.greenColor()
var attributeDictionary = [NSFontAttributeName: boldFont, NSForegroundColorAttributeName: greenColor]
var attibuteString = NSAttributedString(string: "demo", attributes: attributeDictionary)
testButton.setAttributedTitle(attibuteString)
but when i run the code, my button only change the title to the "demo" and it didn't change the color also the font. Did i miss something?
asked 33 secs ago
How can set attributed title for WKInterfaceButton in swift?
Aucun commentaire:
Enregistrer un commentaire