UIAlertController字型顏色

weixin_34075551發表於2016-03-31
 UIAlertController *alertController = [[UIAlertController alloc] init];
    UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    UIAlertAction *action1 = [UIAlertAction actionWithTitle:@"你丫的" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSLog(@"你丫的點選");
    }];
//給字型設定為橘黃色
    [action1 setValue:[UIColor orangeColor] forKey:@"_titleTextColor"];
    [alertController addAction:cancel];
    [alertController addAction:action1];
    [self presentViewController:alertController animated:YES completion:nil];

相關文章