如何更改 UINotification 的警报外观?
有什么方法可以改变 UINotification Alert 的外观(外观形状),就像我可以在 UIAlertView 上插入图像一样,如下所示
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Status Update" message:myString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 30, 100, 100)];
NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"reminder_logo.png"]];
UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path];
[imageView setImage:bkgImg];
[bkgImg release];
[path release];
[alert addSubview:imageView];
[imageView release];
[alert show];
[alert release];
此代码将在 UIAlertView 上显示图像。我想要 UINotification 同样的东西,但苹果应该接受它,因为我不能改变他们的库,否则应用商店会拒绝。
is there any way to change the outlook(appearance shape) of UINotification Alert, like I can insert image on UIAlertView, as below
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Status Update" message:myString delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 30, 100, 100)];
NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"reminder_logo.png"]];
UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path];
[imageView setImage:bkgImg];
[bkgImg release];
[path release];
[alert addSubview:imageView];
[imageView release];
[alert show];
[alert release];
This code will show an image on UIAlertView. I want same thing for UINotification, but apple should accept it, because I can't alter their libraries, else rejection will happen from app store.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本地通知是由系统而不是您的应用程序创建和显示的。因此,您无法控制它们的呈现方式。
Local notifications are created and displayed by the system, not your app. Therefore you have no control over how they are presented.