在本地通知的警报主体中显示图像
我正在使用本地通知,但我想要在警报的消息正文中放置一个图像。 我怎样才能做到这一点?
我也search了同样的问题 。 并发现我们不能自定义UILocalNotification
,所以我在application:didReceiveLocalNotification:
处理了这个application:didReceiveLocalNotification:
通过显示自定义的UIAlertView
。
这应该工作。 给它一个旋转:
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];
祝你好运,
Aurum Aquila
如果你正在使用像问号,通知等简单的图像,我build议Ext JS有一个图标types警报。
你也可以添加你的图片。