TextGradation 0.2.0

TextGradation 0.2.0

‘pikachu987’, pikachu987 维护。



  • pikachu987

TextGradation

Version License Platform Swift 4.2

简介

您可以为 UILabel 或 UIButton 上的文本添加渐变。

demo

demo2

要求

TextGradation是用 Swift 4.2 编写的。兼容 iOS 8.0+。

安装

TextGradation 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'TextGradation'

Xib 或 Storyboard 文件

GradationLabel

image

image

GradationButton

image

image




代码编辑器

import TextGradation
gradationLabel.gradation(.horizontal, colors: [UIColor.gray, UIColor.red, UIColor.blue, UIColor.black])

gradationButton.gradation(.horizontal, colors: [UIColor.gray, UIColor.red, UIColor.blue, UIColor.black])

进度

gradationProgressHorizontalLabel.gradation(.horizontal, startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1), endColor: .black, progress: CGFloat(sender.value))

gradationProgressVerticalLabel.gradation(.vertical, startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1), endColor: .black, progress: CGFloat(sender.value))

gradationProgressHorizontalButton.gradation(.horizontal, startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1), endColor: .black, progress: CGFloat(sender.value))

gradationProgressVerticalButton.gradation(.vertical, startColor: UIColor(red: 106/255, green: 183/255, blue: 216/255, alpha: 1), endColor: .black, progress: CGFloat(sender.value))

作者

pikachu987, [email protected]

许可协议

TextGradation 可在 MIT 许可证下获得。有关更多信息,请参阅 LICENSE 文件。