美文网首页
Gradient 渐变UILabel、UIButton

Gradient 渐变UILabel、UIButton

作者: Ray_Boring | 来源:发表于2019-05-05 21:21 被阅读0次

轻量级渐变UILabel和UIButton解决方法

GitHub

pod 'GradientX'

Usage

//MARK: - Label
let label = GradientLabel()

///更改颜色
label.new(colors: [UIColor.red.cgColor, UIColor.black.cgColor, UIColor.white.cgColor])

/// 更改方向
label.new(direction: .vertical)


//MARK: - Button
let button = GradientButton()

///更改颜色
button.new(colors: [UIColor.red.cgColor, UIColor.black.cgColor, UIColor.white.cgColor])

/// 更改方向
button.new(direction: .vertical)

Storyboard

usage_1.jpg

ScreenShots

screenshots_1.jpg

相关文章

网友评论

      本文标题:Gradient 渐变UILabel、UIButton

      本文链接:https://www.haomeiwen.com/subject/veckoqtx.html