Possible Duplicate:
Image in UIAlertView
I am implementing a puzzle game. after player won I'm showing an alert that You won. but with that I want to add smiley on my alert view. How to do that?
Possible Duplicate:
Image in UIAlertView
I am implementing a puzzle game. after player won I'm showing an alert that You won. but with that I want to add smiley on my alert view. How to do that?
use this
UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 40, 40)];
NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"smile.png"]];
UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path];
[imageView setImage:bkgImg];
[bkgImg release];
[path release];
[successAlert addSubview:imageView];
[imageView release];
[successAlert show];
[successAlert release];
copied form here