- (void)willPresentAlertView:(UIAlertView *)alertView; - (void)didPresentAlertView:(UIAlertView *)alertView;
in any of the posts above, check the subviews and their class and change the values ββas you wish. see this sample code for UIActionSheet. find the classes of all components using ns log and customize your wish class. This is the uiaewsheet code
for (UIView* view in [actionSheet subviews]) { NSLog(@"%@",[view class]); if ([[[view class] description] isEqualToString:@"UIAlertButton"] && [view respondsToSelector:@selector(setAlpha:)]) { [view setAlpha:2.0]; [view setOpaque:YES]; if ([view respondsToSelector:@selector(title)]) { NSString* title = [view performSelector:@selector(title)]; if ([title isEqualToString:@"Cancel"] && [view respondsToSelector:@selector(setBackgroundImage:forState:)] && [view respondsToSelector:@selector(setFrame:)] && [view respondsToSelector:@selector(setFrame:)] && [view respondsToSelector:@selector(setTitleColor:forState:)]) { [view setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [view setBackgroundImage:[UIImage imageNamed:@"btn-cancel.png"] forState:UIControlStateNormal]; [view setFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y+10, view.frame.size.width,view.frame.size.height)]; } } } }
source share