I use green as the "action color" throughout my app, and I want the options in my UIActionSheets to be green as well, for consistency. How can I change the colour of the UIActionSheet options to green from blue?
Utilize the willPresentActionSheet
delegate method of UIActionSheet
to change the action sheet button color.
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
for (UIView *subview in actionSheet.subviews) {
if ([subview isKindOfClass:[UIButton class]]) {
UIButton *button = (UIButton *)subview;
button.titleLabel.textColor = [UIColor greenColor];
}
}
}