SwiftFillButton
Swift 中的一个简单按钮,在点击时填充。
安装
SwiftFillButton 可通过 CocoaPods 获取。要安装它,只需将以下行添加到您的 Podfile 中
pod 'SwiftFillButton'
使用
首先使用以下命令导入模块
import SwiftFillButton
然后您可以按以下方式程序化地配置按钮
let button3 = FillButton()
// The highlight color is the color that the backround will be on click
button3.highlightColor = UIColor.purple
button3.unhighlightColor = UIColor.cyan
// To set the text bold on click
button3.isHighlightBold = true
// To add zoom on click
button3.doesZoom = true
// If the zoomScale is greater than 1 the button will increase in size on click
// if it's less than 1 the button will be smaller on click
button3.zoomScale = 1.05
Interface Builder (Storyboard/Xib)
按常规添加一个 UIButton
,然后
- 将基础类修改为
SwiftFillButton/FillButton
,并将模块修改为SwiftFillButton
- 确保将
UIButtonType
设置为.custom
示例
要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install
。
作者
kha26, [email protected]
许可证
SwiftFillButton 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。