MARoundButton可以通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中
pod 'MARoundButton'
MARoundButton可以通过在视图中添加UIButton并在身份检查器中选中MARoundButton作为类和模块来通过Storyboard使用。所有属性都可以在属性检查器选项卡内更改。
MARoundButton还可以像普通UIButton一样通过代码使用。只需记住设置圆形按钮属性。
首先导入MARoundButton
import MARoundButton
然后设置一个类似于以下按钮
let btn = MARoundButton(frame: CGRect(x: 20, y: 40, width: 50, height: 50))
btn.backgroundColor = UIColor.brown
btn.setTitle("BTN", for: .normal)
btn.tintColor = UIColor.white
// MARoundButton
btn.borderColor = UIColor.black
btn.border = 2
btn.corner = 23
btn.borderAlpha = 0.5
self.view.addSubview(btn)
Tyler Miller
MARoundButton根据MIT许可证提供。有关更多信息,请参阅LICENSE文件。