PPNumberButtonSwift 1.默认样式2.边框样式3.自定义加减按钮的标题4.自定义加减按钮的背景图片 介绍
可定制的商品数量加减按钮 PPNumberButton
是OC版,swift版的自定义程度和功能与OC版一致;详细介绍
支持cocoaPods导入,欢迎Star!
Usage 使用方法
1.默认样式
let numberButton = PPNumberButtonSwift.init(frame: CGRect(x: 100, y: 100, width: 110, height: 30))//开启抖动动画numberButton.shakeAnimation(true)//加减按钮的闭包回调numberButton.numberResult { (number) in print(number) } view.addSubview(numberButton)
2.边框样式
let numberButton = PPNumberButtonSwift.init(frame: CGRect(x: 100, y: 160, width: 200, height: 30))//设置边框颜色numberButton.borderColor(UIColor.grayColor())//加减按钮的闭包回调numberButton.numberResult { (number) in print(number) } view.addSubview(numberButton)
3.自定义加减按钮的标题
let numberButton = PPNumberButtonSwift.init(frame: CGRect(x: 100, y: 220, width: 150, height: 44))//设置加减按钮的标题numberButton.setTitle(decreaseTitle: "加", increaseTitle: "减")//设置加减按钮标题的字体大小numberButton.buttonTitleFont(UIFont.systemFontOfSize(15))//开启抖动动画numberButton.shakeAnimation(true)//加减按钮的闭包回调numberButton.numberResult { (number) in print(number) } view.addSubview(numberButton)
4.自定义加减按钮的背景图片
let numberButton = PPNumberButtonSwift.init(frame: CGRect(x: 100, y: 300, width: 100, height: 30))//设置加减按钮的自定义图片numberButton.setimage(decreaseImage: UIImage.init(named: "decrease_highlight")!, increaseImage: UIImage.init(named: "timeline_relationship_icon_addattention-1")!)//开启抖动动画numberButton.shakeAnimation(true)//加减按钮的闭包回调numberButton.numberResult { (number) in print(number) } view.addSubview(numberButton)
PPNumberButtonSwift 1.默认样式2.边框样式3.自定义加减按钮的标题4.自定义加减按钮的背景图片 官网
https://github.com/jkpang/PPNumberButtonSwift
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。