开发者

How can I use iOS's standard red number badges within my app? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. 开发者_运维问答

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 8 years ago.

Improve this question

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.

Thanks,

Luke


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


I am using this by Sascha Paulus - http://www.spaulus.com/2011/04/custombadge-2-0-retina-ready-scalable-light-reflex/?lang=en

Which is a class that you can drop into your project, easy enough to customize for the appearance you are looking for. I had a slight issue with the placement of the number within the red badge so I shifted it slightly. Other than that, all good.


This one looks 100% like the Apple one and it's also completely customizable: https://github.com/JaviSoto/JSBadgeView

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜