1

NSUSerNotification通过以下方式创建一个:

NSUserNotification *notification = [[NSUserNotification alloc] init];
[notification setTitle:notificationTitle];
[notification setInformativeText:_informativeText];
[notification setSoundName:NSUserNotificationDefaultSoundName];

[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

我希望通知显示多于几秒钟。
如何自定义通知在屏幕上显示的持续时间?

4

0 回答 0