I want to have an UIAlertView
with an image at top and some text under the image.
I know that UIAlertView
is deprecated but I support the iOS version 7 and UIAlertController
is not available in this version.
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
[imageView setImage:[UIImage imageNamed:@"icon.png"]];
[imageView setContentMode:UIViewContentModeScaleAspectFit];
NSString *about = [[NSString alloc] initWithFormat:@"%@\n\n\n\n%@\n%@\n(c) %@ Firm name", imageView, [[self bs] getAppName], [[self bs] getAppYear], [[self bs] getAppVersion]];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:about delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
[alert setValue:imageView forKey:@"accessoryView"];
[alert show];
How did I get the image at the top and the text above? Or can someone give me some good advice how I can solve my problem with a better method?
EDIT: I also saw this page (Is it possible to show an Image in UIAlertView?) bit it didn't helped me. I get the icon only at the end of my text.