Designed by yoon
GranibleLabel
顶部 | 左侧 | 右侧 | 底部 |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
左上对角线 | 左下对角线 | 右上对角线 | 右下对角线 |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
安装
pod 'GranibleLabel'
示例
最多可设置 4 种颜色。 无限模式最多可用三种颜色。
- 设置无动画的普通渐变
/*
* .bottom, .leftTopDiagonal, etc...
*/
let label = GranibleLabel()
label.colors = [UIColor.red, UIColor.orange]
- 设置动画方向
/*
* direction = .bottom, .leftTopDiagonal, etc...
* animate default = false
*/
label.direction = .top
label.animate = true
- 设置无限模式
label.direction = .top
label.animate = true
label.infinity = true
- 设置反向模式
/*
* autoreverses default = false
*/
label.direction = .top
label.animate = true
label.reverse = true
- 以及其他设置
/*
* You can use it just like a normal UILabel.
*/
label.text = "label"
label.textAlignment = .center
label.font = .boldSystemFont(ofSize: 10)
label.numberOfLines = 2
许可证
GranibleLabel 在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。