Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 更改UIAlertController的背景色_Ios_Objective C_Iphone_Background_Uialertcontroller - Fatal编程技术网

Ios 更改UIAlertController的背景色

Ios 更改UIAlertController的背景色,ios,objective-c,iphone,background,uialertcontroller,Ios,Objective C,Iphone,Background,Uialertcontroller,我的代码是 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Touch ID for Eceipt" message:@"Touch ID or Enter Password" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancelButt

我的代码是

    UIAlertController *alert = [UIAlertController
                                 alertControllerWithTitle:@"Touch ID for Eceipt" message:@"Touch ID or Enter Password" preferredStyle:UIAlertControllerStyleAlert];

    UIAlertAction *cancelButton = [UIAlertAction
                                actionWithTitle:@"Cancel"
                                style:UIAlertActionStyleDefault
                                handler:^(UIAlertAction * action) {
                                    //Handle your yes please button action here
                                }];
    alert.view.tintColor=[UIColor blueColor];          
    alert.view.backgroundColor=[UIColor whiteColor];   //this code changes the alert view color
    alert.view.layer.cornerRadius=10;
    [alert addAction:cancelButton];
    [self presentViewController:alert animated:YES completion:nil];
通过这段代码,我可以实现“蓝色取消按钮”和白色警报视图以及灰色背景

我需要的是更多的深色背景。 这是我的输出截图
我需要这样的背景截图

@Anbu.Karthik Narendra Pandey->尝试过,但结果是,它改变了ALTER CONTENTVIEW的颜色。它不会改变Alertcontentview的背景。请参阅:@Anbu.Karthik Narendra Pandey->尝试过,但结果是,它会更改ALTER CONTENTVIEW颜色。它不会更改Alertcontentview的背景。请参阅: