如何创建循环UIButton?

如何创建循环UIButton?

问题描述:

一切都在标题!我想创建一个纯粹的圆形UIButton。我可以这样做迄今为止最好是方形按钮带有圆角... THX如何创建循环UIButton?

可以使用OBShapedButton,https://github.com/ole/OBShapedButton

OBShapedButton是一个UIButton子类非矩形按钮的形状进行了优化。 OBShapedButton的实例仅对分配给UIControlStateNormal按钮的图像不透明的区域作出响应。

你可以设置一个圆形的背景图像,一个近乎圆形的UIButton。没有人会注意到差异。