如何更改UINotification的警报外观?

时间:2021-11-26 20:36:53

is there any way to change the outlook(appearance shape) of UINotification Alert, like I can insert image on UIAlertView, as below

是否有任何方法可以改变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];

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.

此代码将在UIAlertView上显示图像。我想要UINotification一样的东西,但苹果应该接受它,因为我无法改变他们的库,否则将从app store发生拒绝。

1 个解决方案

#1


3  

Local notifications are created and displayed by the system, not your app. Therefore you have no control over how they are presented.

系统会创建并显示本地通知,而不是您的应用。因此,您无法控制它们的呈现方式。

#1


3  

Local notifications are created and displayed by the system, not your app. Therefore you have no control over how they are presented.

系统会创建并显示本地通知,而不是您的应用。因此,您无法控制它们的呈现方式。