xcode ios5中的应用程序图标徽章编号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7835367/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 22:11:04  来源:igfitidea点击:

application Icon Badge Number in ios5

xcodecocoa-touchios5

提问by Skovie

i was just wondering, if that the applicationIconBadgeNumber have been changed in iso 5 ?

我只是想知道,是否 applicationIconBadgeNumber 已在 iso 5 中更改?

cus when i run my apps in the sim the number works fine, but if run it on my iPhone it′s not showing it ?

因为当我在 sim 中运行我的应用程序时,数字工作正常,但是如果在我的 iPhone 上运行它就没有显示它?

i haven't changed my code that was working in iOS 4.3.

我没有更改在 iOS 4.3 中运行的代码。

int a = [[[UIApplication sharedApplication] scheduledLocalNotifications] count];

application.applicationIconBadgeNumber = a ;

been on google all day .....

一整天都在谷歌上......

Hope you can help

希望你能帮忙

回答by Lukman

Most likely because the "Badge App Icon" setting for your app is not turned on in the new Notification Center.

很可能是因为您的应用程序的“徽章应用程序图标”设置未在新的通知中心中打开。

screenshot http://www.karthikk.net/wp-content/uploads/2011/06/turn-off-notifications-ios5-4.png

截图 http://www.karthikk.net/wp-content/uploads/2011/06/turn-off-notifications-ios5-4.png

Go to Settings> Notifications. Find your app either in "In Notification Center" section or "Not In Notification Center" section, and tap on it. Then turn on the "Badge App Icon" setting. p/s: it doesn't matter if you app is not in notification center (i.e. Notification Center = OFF); the badge icon setting does take effect nevertheless.

前往“设置”>“通知”。在“在通知中心”部分或“不在通知中心”部分中找到您的应用,然后点击它。然后打开“徽章应用图标”设置。p/s:如果您的应用程序不在通知中心(即通知中心 = 关闭),则无关紧要;尽管如此,徽章图标设置确实生效。