Show an image in the alert body of a local notification

送分小仙女□ 提交于 2019-12-03 09:08:11
KingofBliss

I also searched for the same question. And found that we can't customize the UILocalNotification, so I handled this in application:didReceiveLocalNotification: by showing custom UIAlertView.

This should work. Give it a whirl:

UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:title 
message:message
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 40, 40)]; UIImage *smiley= [UIImage imageNamed:@"smiley.png"]; [imageView setImage:smiley]; [smiley release]; [successAlert addSubview:imageView]; [imageView release]; [successAlert show]; [successAlert release];

Good luck,

Aurum Aquila

If you are using simple images like question mark, notification, etc. I suggest Ext JS which has a Icon type alert.

You can add your images as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!