相关疑难解决方法(0)

如何在iOS7中更改UIAlertView的按钮文字颜色?

iOS7推出了一般的色彩.我认为UIAlertView也在有效范围内,但实际上tintColor看起来不适用UIAlertView.(用于可点击的按钮文字颜色)

是否可以更改警报视图的色调?如果可能,如何改变它?

uialertview tintcolor ios7

19
推荐指数
1
解决办法
2万
查看次数

在Swift中创建一个UIAlertAction

我想创建以下内容UIAlertAction:

IMG1

@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()不起作用.为什么我的代码不起作用?

ios swift uialertcontroller

4
推荐指数
2
解决办法
2万
查看次数

更改UIAlertController选择的按钮颜色

我有这行代码:

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)

我想在选择时更改取消按钮颜色.我怎样才能做到这一点?请帮忙.

objective-c ios swift uialertcontroller

4
推荐指数
1
解决办法
4101
查看次数