OSX通知中心图标 [英] OSX Notification Center Icon

查看:83
本文介绍了OSX通知中心图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次使用OSX的Notification Center API,似乎无法弄清楚如何使我的应用程序图标显示在Notification徽章中.

默认的您的应用没有图标"图标一直显示:

这是我到目前为止所做的

  • 我创建了一个icns文件,其中包含512、256、128、32和16px版本
  • 将图标拖到目标摘要的应用程序图标"部分
  • 我确保选中将图标复制到项目中的框
  • plist的图标文件"部分引用了正确的图标名称(减去.icns)部分

有什么想法吗?当我通过Xcode运行应用程序或导出存档时,该图标都不会显示.

我还从Sparrow.app中提取了Sparrow.icns文件,并尝试使用该文件而不是我制作的文件.那也不起作用.

解决方案

您可以通过删除Notification Center数据库文件(~/Library/Application Support/NotificationCenter/SOME_UUID.db),然后取消Notification Center进程(例如,强制通知中心)来刷新所有图标. ,来自活动监视器".

不幸的是,这具有删除通知历史记录的副作用,但这对我来说并不是一个大问题.

I'm using OSX's Notification Center APIs for the first time and can't seem to figure out how to make my app's icon to show up in the Notification badge.

The default "your app doesn't have an icon" icon keeps showing up:

Here's what I've done so far

  • I have created an icns file that includes 512, 256, 128, 32 & 16px versions
  • dragged the icon into the "App Icon" section of the target's summary
  • I made to sure to check the box to copy the icon into the project
  • the plist's "Icon file" section references the correct icon name (minus the .icns) part

Any ideas? The icon doesn't show up when I run the app thru Xcode or when I export an archive either.

I also have extracted the Sparrow.icns file from Sparrow.app and tried using that one instead of the one I made. That didn't work either.

解决方案

You can force the Notification Center to refresh all of the icons by deleting the Notification Center database file (~/Library/Application Support/NotificationCenter/SOME_UUID.db) and then killing the Notification Center process (e.g., from Activity Monitor).

Unfortunately this has the side effect of deleting your notification history, but this wasn't too much of an issue for me.

这篇关于OSX通知中心图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆