5

更改 UIAlertViewController 对象的消息和标题的字体已在此处得到解答:如何在 UIAlertController 中更改 UIAlertAction 的字体大小和颜色

但我想知道如何使用 Swift 更改 UIAlertAction (iOS8+) 标题上的字体。不幸的是,UIAlertAction 实例没有一个名为“attributedTitle”的属性,就像 UIAlertController 一样。

我想扩展以更改字体的代码如下:

let alertAction = UIAlertAction(title: "Got It!", style: .Default, handler: nil)
alertController.addAction(alertAction)

任何想法将不胜感激。

4

0 回答 0