This is the current way i'm customizing my buttons:
UIAlertView *av = [[UIAlertView alloc] init];
[av addButtonWithTitle:@""];
UIButton *yesButton = [av.subviews lastObject];
[av show];
[yesButton setImage:[UIImage imageNamed:@"test.png"] forState:UIControlStateNormal];
The problem with this is that the original view is still visible around the image I set for the button. It doesn't completely encapsulate the image. Here's an example of what I have so far:
https://www.dropbox.com/s/htb9pfihwmel5oo/testimage.png
Is there anyway to make it so that the image completely takes up the entire button?
If you wan't something that's not as robust as Sly Raskal's answer and just want a quick hack, that works similar to your existing code. You could do something like this..Of course you can change the new buttons frame to match how you want it. Also, you would have to define the UIAlertView as a variable to so you have a reference to it, and dismiss it in your someAction: method.
UIAlertView *av = [[UIAlertView alloc] init];
[av addButtonWithTitle:@""];
UIButton *yesButton = [av.subviews lastObject];
[yesButton setHidden:YES];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[av addSubview:button];
[av show];
[button setImage:[UIImage imageNamed:@"test.png"] forState:UIControlStateNormal];
[button addTarget:av action:@selector(someAction:) forControlEvents:[yesButton allControlEvents]];
[button setFrame:yesButton.frame];
If in this case all you are doing is styling the buttons to look different, but in a simple fashion, I would follow this tutorial to accomplish the effect you are looking for:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-uialertview-custom-graphics/
If the application you are creating is destined for the App Store, I just want to also mention that whatever changes you implement, be sure it doesn't use any private API's or goes against anything documented in the HIG. Either of these circumstances is surely going to red flag your app for rejection.