如何创建圆形UIButton? [英] How Do I Create a Circular UIButton?
本文介绍了如何创建圆形UIButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一切都在标题中!我想创建一个纯粹的圆形UIButton。到目前为止,我能做的最好的是带圆角的方形按钮...
Thx
Everything is in the title ! I would like to create a purely circular UIButton. The best I could do so far is a square button with rounded corners... Thx
推荐答案
你可以使用OBShapedButton, https://github.com/ole/OBShapedButton
you can use OBShapedButton, https://github.com/ole/OBShapedButton
OBShapedButton是一个针对非矩形按钮形状优化的UIButton子类。 OBShapedButton的实例仅响应分配给UIControlStateNormal按钮的图像不透明的区域中的触摸。
OBShapedButton is a UIButton subclass optimized for non-rectangular button shapes. Instances of OBShapedButton respond to touches only in areas where the image that is assigned to the button for UIControlStateNormal is non-transparent.
这篇关于如何创建圆形UIButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文