如何在我的应用程序中使用iOS的标准红色数字徽章? [英] How can I use iOS's standard red number badges within my app?

查看:169
本文介绍了如何在我的应用程序中使用iOS的标准红色数字徽章?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在主屏幕上的应用程序图标上添加红色数字徽章是微不足道的。在我的应用程序中获得这样的徽章的最佳方法是什么?我在网上找到的一些课程可以做到这一点,例如 MKNumberBadgeView ,但是没有,我发现看起来完全正确。例如,就我所见,Facebook完美地在应用程序中实现了红色徽章。他们只是通过反复试验来建立自己的徽章吗?任何建议将不胜感激。

I know that it's trivial to add a red number badge to an app's icon on the home screen. What's the best way to get a badge that looks like this within my app? There are some classes I've found online that can do this, such as MKNumberBadgeView, but none that I've found look completely right. Facebook, for example, implements red badges within the app perfectly as far as I can see. Did they just build their own badges by trial and error? Any suggestions would be appreciated.

谢谢,

卢克

推荐答案

你想要徽章在哪里?标准徽章可以通过 badgeValue 属性轻松添加到 UITabBarItem 。它记录在这里

Where do you want the badge? The standard badge can trivially be added to a UITabBarItem through the badgeValue property. It is documented here.

这篇关于如何在我的应用程序中使用iOS的标准红色数字徽章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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