这是我创建UIAlertController的代码
// Create the alert controller
var alertController = UIAlertController(title: "Are you sure you want to call \(self.number)?", message: "", preferredStyle: .Alert)
// Create the actions
var okAction = UIAlertAction(title: "Call", style: UIAlertActionStyle.Default) {
UIAlertAction in
var url:NSURL = NSURL(string: "tel://\(self.number)")!
UIApplication.sharedApplication().openURL(url)
}
var cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel) {
UIAlertAction in
}
// Add the actions
alertController.addAction(okAction)
alertController.addAction(cancelAction)
// Present the controller
self.presentViewController(alertController, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚如何更改取消和调用操作的文本颜色.标题文本目前为黑色,取消和呼叫按钮为白色.我正在努力让它们全黑,以提高能见度.有任何想法吗?谢谢!