【发布时间】:2017-06-12 06:26:20
【问题描述】:
let alertController: UIAlertController = UIAlertController(title: "Alert", message: nil, preferredStyle: .alert)
let customActionButton: UIAlertAction = UIAlertAction(title: "Custom", style: .default) { action -> Void in
}
let attrString: NSAttributedString = NSAttributedString(string: "Custom", attributes: [NSFontAttributeName: UIFont.init(name: "Roboto-Regular", size: 17.0)!])
customActionButton.setValue(attrString, forKey: "attributedTitle")
alertController.addAction(customActionButton)
present(alertController, animated: true, completion: nil)
任何人都可以告诉我是否可以在 swift 中更改警报操作按钮
【问题讨论】:
-
no 是不可能的,如果你需要这样,那么你可以使用 customViews
标签: ios swift alert uialertcontroller uialertaction