WCLShineButton
这是一个用于 iOS 的 UI 库。具有发光等效果。
简体中文
中文说明
博客介绍
CocoaPods
CocoaPods 是推荐的方法,将 WCLShineButton
添加到您的项目中。
在您的 Podfile 中添加 WCLShineButton
的 pod 条目。
pod 'WCLShineButton'
其次,将 WCLShineButton
安装到您的项目中。
pod install
使用 import WCLShineButton
将 WCLShineButton 包含在任何需要它的地方。
Carthage
Carthage 是一个去中心化的依赖项管理器,它构建您的依赖项并提供二进制框架。要使用 Carthage 将 WCLShineButton
集成到您的 Xcode 项目中,请在您的 Cartfile
中指定它。
github "imwcl/WCLShineButton"
运行 carthage update
以构建框架,并将构建的 WCLShineButton.framework
(位于 Carthage/Build/iOS 文件夹中)拖放到您的 Xcode 项目中(在 Targets
中的“链接框架和库”)。
使用
var param1 = WCLShineParams()
param1.bigShineColor = UIColor(rgb: (153,152,38))
param1.smallShineColor = UIColor(rgb: (102,102,102))
let bt1 = WCLShineButton(frame: .init(x: 100, y: 100, width: 60, height: 60), params: param1)
bt1.fillColor = UIColor(rgb: (153,152,38))
bt1.color = UIColor(rgb: (170,170,170))
bt1.addTarget(self, action: #selector(action), for: .valueChanged)
view.addSubview(bt1)
复杂使用
属性 | 描述 |
---|---|
color |
默认按钮颜色 |
fillColor |
填充按钮颜色 |
allowRandomColor |
允许颜色随机 |
animDuration |
闪光动画持续时间 |
bigShineColor |
大闪光颜色 |
enableFlashing |
启用类似闪烁的效果 |
shineCount |
按钮周围的闪烁次数 |
shineTurnAngle |
闪烁角度 |
shineDistanceMultiple |
到按钮的距离的比例 |
smallShineOffsetAngle |
小闪烁到大的闪烁的角度偏移 |
smallShineColor |
小闪烁的颜色 |
shineSize |
闪烁大小(像素为单位) |
colorRandom |
闪烁颜色随机 |
image |
按钮图像(png格式) |
联系人
代码参考
许可
WCLShineButton遵循MIT许可。有关详细信息,请参阅LICENSE文件。