UIAlertController custom font, size, color

后端 未结 25 1994
遥遥无期
遥遥无期 2020-11-22 09:06

I am using new UIAlertController for showing alerts. I have this code:

// nil titles break alert interface on iOS 8.0, so we\'ll be using empty strings
UIAle         


        
25条回答
  •  一个人的身影
    2020-11-22 09:55

    Solution/Hack for iOS9

        UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Test Error" message:@"This is a test" preferredStyle:UIAlertControllerStyleAlert];
    
        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
            NSLog(@"Alert View Displayed");
     [[[[UIApplication sharedApplication] delegate] window] setTintColor:[UIColor whiteColor]];
        }];
    
        [alertController addAction:cancelAction];
        [[[[UIApplication sharedApplication] delegate] window] setTintColor:[UIColor blackColor]];
        [self presentViewController:alertController animated:YES completion:^{
            NSLog(@"View Controller Displayed");
        }];
    

提交回复
热议问题