Ich habe eine alert
in meinem Projekt. Die alert
ist einfach wie jede andere Warnung. Ich möchte die font style and color
ändern. Wie ist das möglich?Swift 3 - Alarmstil
Vielen Dank im Voraus!
Ich habe eine alert
in meinem Projekt. Die alert
ist einfach wie jede andere Warnung. Ich möchte die font style and color
ändern. Wie ist das möglich?Swift 3 - Alarmstil
Vielen Dank im Voraus!
let attributedString = NSAttributedString(string: "YourTitle", attributes: [
NSFontAttributeName : UIFont.systemFontOfSize(18), //your font here
NSForegroundColorAttributeName : UIColor.black()
])
let alert = UIAlertController(title: "TextTitle", message: "YourMessage", preferredStyle: .Alert)
alert.setValue(attributedString, forKey: "attributedTitle")
let cancelAction = UIAlertAction(title: "Cancel",
style: .Default) { (action: UIAlertAction!) -> Void in
}
presentViewController(alert,
animated: true,
completion: nil)
können Sie SweetAlert
SweetAlert().showAlert("Here's a message!", subTitle: "It's pretty, isn't it?", style: AlertStyle.None)
vollständige Dokumentation & Implementierung Link: https://github.com/codestergit/SweetAlert-iOS