1

How to set a title backgroundcolour in UIAlertController's ActionSheet in iOS 8 ?

The following code is what I have tried. But I don't know to set the title colour of ActionSheet.

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

// Action sheet style.
   UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"Evacuate Building!" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];

__weak ViewController *wself = self;

UIAlertAction *destructiveAction = [UIAlertAction actionWithTitle:@"Kick through door" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
    __strong ViewController *sself = wself;
    sself.actionResponseLabel.text = @"Careful!";
}];

UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:@"Walk calmly" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
    __strong ViewController *sself = wself;
    sself.actionResponseLabel.text = @"Find nearest exit.";
}];

UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Do nothing" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
    __strong ViewController *sself = wself;
    sself.actionResponseLabel.text = @"Just relax";
}];


[actionSheet addAction:destructiveAction];
[actionSheet addAction:defaultAction];
[actionSheet addAction:cancelAction];
actionSheet.view.tintColor = [UIColor blackColor];

UIColor *customTitleColor=[UIColor colorWithRed:(0.0/255.0) green:(159.0/255.0) blue:(196.0/255.0) alpha:1.0];         //  **I need to set this colour to title.** 

[self presentViewController:actionSheet animated:YES completion:nil];  

}
Alen Alexander
  • 725
  • 6
  • 22
  • 1
    You don't need the weak/strong stuff here because there's no retain cycle being made. Also, this is a duplicate of [UIAlertController custom font, size, color](http://stackoverflow.com/questions/26460706/uialertcontroller-custom-font-size-color) – Aaron Brager Apr 03 '15 at 11:38

0 Answers0