0
私のプロジェクトにはalert
があります。 alert
は他のアラートと同じようにシンプルです。私はfont style and color
を変更したいと思います。そんなことがあるものか?Swift 3 - アラートスタイル
ありがとうございます!
私のプロジェクトにはalert
があります。 alert
は他のアラートと同じようにシンプルです。私はfont style and color
を変更したいと思います。そんなことがあるものか?Swift 3 - アラートスタイル
ありがとうございます!
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)
あなたが使用することができますSweetAlert
SweetAlert().showAlert("Here's a message!", subTitle: "It's pretty, isn't it?", style: AlertStyle.None)
完全なドキュメント&実装リンク:https://github.com/codestergit/SweetAlert-iOS