如何向标准UIButton添加徽章? [英] How can I add a badge to a standard UIButton?

查看:196
本文介绍了如何向标准UIButton添加徽章?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以向标准 UIButton 添加标准外观徽章?

Is it possible to add a standard-looking badge to a standard UIButton?

如果不支持

示例图片:

推荐答案

这里是Sascha Paulus的一个非常好的类,名为 CustomBadge ,它使用Core Graphics构建和呈现自定义徽章。它们只是UIView子类,所以你使用它们的框架就像任何其他UIView子类。

Here's a VERY NICE class by Sascha Paulus called CustomBadge, that builds and renders custom badges using Core Graphics. They're just UIView subclasses, so you lay them out using their frame just like any other UIView subclass.

我已经使用了这个库多次,总是很高兴结果。灵活,使用方便。完全推荐它。

I've used this library many times and always been pleased with the results. Flexible, easy to use. Totally recommend it.

这篇关于如何向标准UIButton添加徽章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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