在运行时更改iOS 4中某个应用程序的图标 [英] Change icon on of an App in iOS 4 in run-time

查看:63
本文介绍了在运行时更改iOS 4中某个应用程序的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时更改iOS 4中我的应用程序的图标,就像日历应用程序的图标根据今天的日期更改一样?

How can I change the icon of my App in iOS 4 at run-time the way the icon of the Calendar app changes based on the date today?

我想每天发布一次4位数字的电话号码,而无需用户打开应用程序来查找它.

I want to publish a 4 digit number number once per day without the user having to open the app to chaeck it.

推荐答案

在Apple认可的API范围内,您现在可以做的最好的事情就是使用UIApplication 在图标上添加带有数字的红色徽章.applicationIconBadgeNumber 属性.不确定它的大小是否足以容纳4位数字.

The best you can do right now within the bounds of Apple-sanctioned APIs is to add a red badge with a number to the icon using the UIApplication applicationIconBadgeNumber property. Not sure if it's big enough to fit 4 digits though.

那是您要在打开应用程序时进行设置.要在后台更新徽章,您将需要发布 UILocalNotification (如果您提前知道徽章应该说什么时候和说什么),或者使用推送通知.

That's if you want to set it while the app is open. To update the badge in the background, you will need to either post a UILocalNotification (if you know ahead of time when and what the badge should say), or use push notifications.

这篇关于在运行时更改iOS 4中某个应用程序的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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