0

以下のように、UIAlertViewに画像を挿入できるように、UINotification Alertのoutlook(外観形状)を変更する方法はありますか?

    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 についても同じことが必要ですが、ライブラリを変更できないため、Apple はそれを受け入れる必要があります。そうしないと、アプリ ストアから拒否されます。

4

1 に答える 1

3

ローカル通知は、アプリではなく、システムによって作成および表示されます。したがって、それらの表示方法を制御することはできません。

于 2011-02-22T08:27:53.707 に答える