有没有一种方法,以徽章添加到Android的应用程序图标? [英] Is there a way to add a badge to an application icon in Android?

查看:116
本文介绍了有没有一种方法,以徽章添加到Android的应用程序图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPhone上,你可以添加带编号的徽章应用程序图标。黑莓,我已经成功地画一个图像到应用程序的图标,而在程序中。我想这样做对于Android也是如此。我不希望使用通知栏,因为它不是一个需要即时通知。相反,我只是希望用户能够看到新邮件有多少应用程序只需通过查看应用程序图标。

On the iPhone, you can add a numbered badge to the application icon. On BlackBerry, I've successfully painted an image onto the application's icon while in the program. I want to do this for Android as well. I don't want to use the notification bar, as it's not something that needs to be notified instantly. Instead, I just want the user to be able to see how many new messages are in the application just by looking at the application icon.

推荐答案

不幸的是,Android的不允许应用程序图标的变化,因为它是密封在APK一旦程序被编译。有没有办法以编程方式将其更改为绘制。

Unfortunately, Android does not allow changing of the application icon because it's sealed in the APK once the program is compiled. There is no way to programmatically change it to a 'drawable'.

您可以通过使用一个小部件,而不是一个图标,实现自己的目标。窗口小部件是高度可定制的,可以做你想做的。

You may achieve your goal by using a widget instead of an icon. Widgets are highly customisable and can do what you want.

有一个关于iPhone的图标通知,并使用此控件之间的差异简短的讨论:

There's a short discussion about the difference between iPhone icon notification and using widgets here:

<一个href="http://www.cnet.com/8301-19736_1-10278814-251.html">http://www.cnet.com/8301-19736_1-10278814-251.html

正如你会发现,有一种使用小部件或图标,因为它们可以是相同的尺寸和外观相同基本没有差别。

As you'll notice, there is virtually no difference between using a widget or an icon, since they can be the same size and look the same.

这篇关于有没有一种方法,以徽章添加到Android的应用程序图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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