我正在使用本地通知,但我想在警报的消息正文中放置一张图片。我怎样才能做到这一点?
问问题
4825 次
3 回答
8
我也搜索了同样的问题。并发现我们无法自定义UILocalNotification
,所以我application:didReceiveLocalNotification:
通过显示 custom来处理这个问题UIAlertView
。
于 2011-02-09T06:50:09.667 回答
0
这应该有效。试一试:
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];
祝你好运,
金天鹰座
于 2011-02-09T06:40:02.220 回答
-1
如果您使用的是简单的图像,如问号、通知等。我建议使用具有图标类型警报的Ext JS 。
您也可以添加图像。
于 2011-02-09T06:43:22.157 回答