Iphone IOS5中的本地通知-如何使其在屏幕上而不是在通知中心中弹出?
我有一个使用本地通知的应用程序。 现在,当IOS5退出并显示通知警报时,它将转到通知中心,现在使用我的2个按钮(显示和取消)显示警报 谁能帮我弄清楚,这样我就可以在屏幕上弹出,而不是在通知中心(屏幕顶部的那一行) 这是我的代码:Iphone IOS5中的本地通知-如何使其在屏幕上而不是在通知中心中弹出?,iphone,objective-c,ios5,uilocalnotification,Iphone,Objective C,Ios5,Uilocalnotification,我有一个使用本地通知的应用程序。 现在,当IOS5退出并显示通知警报时,它将转到通知中心,现在使用我的2个按钮(显示和取消)显示警报 谁能帮我弄清楚,这样我就可以在屏幕上弹出,而不是在通知中心(屏幕顶部的那一行) 这是我的代码: UILocalNotification *localNotif = [[UILocalNotification alloc] init]; localNotif.fireDate=[NSDate date];
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate=[NSDate date];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = @"Application alerted";
localNotif.alertAction = @"Show";
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 0;
[[UIApplication sharedApplication]presentLocalNotificationNow:localNotif];
[localNotif release];
谢谢,
Amir。只有用户自己可以配置如何显示通知警报。用户还可以禁用应用程序的通知,或禁止它们进入通知中心。没有用于此的开发人员API。您的意思是
UIAlertView
?您可以使用-(id)initWithTitle
创建一个AlertView
。。。您可以配置按钮,如果您的类是UIAlertViewDelegate
,则您可以监听按钮单击等。它将弹出屏幕,允许用户取消该按钮或其他操作。iOS 5仍在保密协议下,我不建议在此谈论它。警报操作字符串将显示在锁定屏幕中,当您滑过通知或在警报窗口中时(仅当用户将安装应用程序通知显示为警报时)