2

I'm trying to change the background highlight color for my alertcontroller. For eg in the below image, right now the default background highlight for a cell is light gray, I need to change it to some other color. I saw various post on changing the tint color but I dont need to change the title color only the background highlight. Is this possible?

enter image description here

//This is my current code

- (IBAction)showAlert:(UIButton *)sender {

    UIAlertController *alert =[UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];


    UIAlertAction* save = [UIAlertAction
                                actionWithTitle:@"Save"
                                style:UIAlertActionStyleDefault
                                handler:^(UIAlertAction * action)
                                {
                                    //Perform some action


                                }];

    UIAlertAction* saveas = [UIAlertAction
                                actionWithTitle:@"Save As"
                                style:UIAlertActionStyleDefault
                                handler:^(UIAlertAction * action)
                                {
                                    //Perform some action


                                }];

    UIAlertAction* discard = [UIAlertAction
                                actionWithTitle:@"Discard"
                                style:UIAlertActionStyleDestructive
                                handler:^(UIAlertAction * action)
                                {
                                    //Perform some action


                                }];

    [alert addAction:save];
    [alert addAction:saveas];
    [alert addAction:discard];


    [alert setModalPresentationStyle:UIModalPresentationPopover];
    UIPopoverPresentationController *popPresenter = [alert popoverPresentationController];

    popPresenter.sourceView = sender;
    popPresenter.sourceRect = sender.bounds;
    [self presentViewController:alert animated:YES completion:nil];


}
Francis F
  • 3,157
  • 3
  • 41
  • 79

0 Answers0