设置自定义时间,显示NS​​UserNotification

时间:2014-06-21 15:43:37

标签: macos cocoa notifications nsusernotification nsusernotificationcenter

我通过以下方式创建NSUSerNotification

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

[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];

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

0 个答案:

没有答案