UIButton 子类 TintingButton
- 授权协议: MIT
- 开发语言: Swift
- 操作系统: iOS
- 软件首页: https://github.com/Dominoo/TintingButton
- 官方下载: https://github.com/Dominoo/TintingButton
软件介绍
TintingButton 是 UIButton 的子类,利用 tintColor 和 UIImage 渲染模式。
All Colored mode
let btnShare = TintingButton(completelyTintedWith: .whiteColor(), activeTintColor: .greenColor()) btnShare.setImage(imageShare, forState: UIControlState.Normal) btnShare.setTitle(title, forState: UIControlState.Normal)
Title Image Colored mode
let btnShare = TintingButton(titleAndImageTintedWith: whiteColor(), activeTintColor: .greenColor()) btnShare.setImage(imageShare, forState: UIControlState.Normal) btnShare.layer.borderColor = .grayColor().CGColor btnShare.layer.borderWidth = 1 btnShare.setTitle(title, forState: UIControlState.Normal)
