我想根据我的应用程序主题更改我的警报视图标题和按钮颜色,为此,我找到了许多解决方案,如下所示:
alertController.view.tintColor = UIColor.red但是上面的代码只改变了按钮标题的颜色,而不是Alert标题。
使用Xcode9.1在iOS 11上进行测试
发布于 2017-12-06 13:14:12
使用以下代码更改警报标题:
alertController.setValue(NSAttributedString(string: "test", attributes: [NSAttributedStringKey.font : UIFont.boldSystemFont(ofSize: 15),NSAttributedStringKey.foregroundColor : UIColor.red]), forKey: "attributedTitle")

https://stackoverflow.com/questions/47667001
复制相似问题