安卓:添加徽章图标内部到我的应用程序 [英] Android: add badge to icons internal to my app

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

问题描述

我想添加徽章的图标在我的Andr​​oid应用程序。例如在Facebook的应用程序(适用于iPhone),在主页上挂起请求的数量显示在请求图标。

I am trying to add badges to the icons in my android app. e.g. in the facebook app(for iPhone), in the home page the number of pending requests is shown on the requests icon.

有人可以提供任何链接/关于如何做到这一点的想法?

Can someone provide any links/ideas on how to do this?

感谢

推荐答案

如果你真的想这样做。使用的FrameLayout ,其中包含一个的ImageView 与你的图标和的TextView 与ninepatch绘制作为背景的​​右下角。添加边距到的ImageView 如果您希望徽章有点图标之外。

If you really want to do it. Use a FrameLayout which contains an ImageView with your icon and a TextView with a ninepatch drawable as background in the right corner. Add margins to the ImageView if you want the badge to be a bit outside the icon.

这篇关于安卓:添加徽章图标内部到我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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