I'm struggeling with an issuse for quite a while now. Since I don't really find a solution, I hope somebody here will be able to help me.
I have a UIActionSheet that I want to have a different background color. With
[[myAlert layer] setBackgroundColor:[UIColor redColor].CGColor];
I am able to change most of the alert's color. This is how it looks like:
This is how I initialize the UIActionSheet:
UIActionSheet *styleAlert = [[UIActionSheet alloc] initWithTitle:AMLocalizedString(@"SELECT_PICTURE_TITLE", @"Überschrift des Actionsheets")
delegate:self
cancelButtonTitle:AMLocalizedString(@"CANCEL_BUTTON_TITLE", @"Abbrechen butten")
destructiveButtonTitle:nil
otherButtonTitles:AMLocalizedString(@"TAKE_PICTURE_BUTTON_TITLE", @"Bild aufnehmen button"),
AMLocalizedString(@"CAMERA_ROLL_BUTTON_TITLE", @"Aus Bibliothek auswählen"), nil];
// use the same style as the nav bar
[styleAlert showInView:self.parentViewController.tabBarController.view];
//[styleAlert showInView:[self.navigationController view] ];
[styleAlert release];
and
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
actionSheet.layer.backgroundColor = GLOBAL_TINT_COLOR.CGColor;
}
I could not figure out how to set the border with the same color. Any ideas?
Thanks in advance!
You can't redraw the border in a different color, so just remove the border and add your own:
Note that this won't work in *will*PresentActionSheet since
actionSheet
doesn't have asuperview
set at that point.This works on iPhone to theme it, It will probably work on iPad also.