iOS7推出了一般的色彩.我认为UIAlertView也在有效范围内,但实际上tintColor看起来不适用UIAlertView.(用于可点击的按钮文字颜色)
是否可以更改警报视图的色调?如果可能,如何改变它?
我想创建以下内容UIAlertAction:

@IBAction func buttonUpgrade(sender: AnyObject) {
let alertController = UIAlertController(title: "Title",
message: "Message",
preferredStyle: UIAlertControllerStyle.Alert)
let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel) { (action) in
// ...
}
alertController.addAction(cancelAction)
}
Run Code Online (Sandbox Code Playgroud)
我知道a UIAlertController是用a初始化的title,message并且它是否更喜欢显示为警报或操作表.
按下按钮时,我想显示警报,但alert.show()不起作用.为什么我的代码不起作用?
我有这行代码:
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:cancelTitle style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) {
NSLog(@"cancel registration");
}];
[alertController addAction:cancelAction];
alertController.view.tintColor = [UIColor redColor];
Run Code Online (Sandbox Code Playgroud)
我想在选择时更改取消按钮颜色.我怎样才能做到这一点?请帮忙.