Reputation: 347
In UIActionSheet button's text colour is blue. How can I set to red or green or black?
Upvotes: 0
Views: 416
Reputation:
Change the text color by using this simple method.
- (void) changeTextColorForUIActionSheet:(UIActionSheet*)actionSheet
{
UIColor *tintColor = [UIColor redColor];
NSArray *actionSheetButtons = actionSheet.subviews;
for (int i = 0; [actionSheetButtons count] > i; i++)
{
UIView *view = (UIView*)[actionSheetButtons objectAtIndex:i];
if([view isKindOfClass:[UIButton class]])
{
UIButton *btn = (UIButton*)view;
[btn setTitleColor:tintColor forState:UIControlStateNormal];
}
}
}
Upvotes: 1