iOS 动画提交按钮组件 SubmitButton

码农软件 · 软件分类 · 按钮(Button) · 2019-05-22 13:58:29

软件介绍

SubmitButton 是一组iOS 动画提交按钮,采用Swift开发。

效果图:


使用环境:

  • swift2 +

  • xcode7.3 +

使用:

1 创建一个按钮

  • using code

        let frame = CGRect(x: 50, y: 100, width: 200, height: 60)
        button = SubmitButton(frame: frame)
        button.setTitle("Submit", forState: .Normal)        
        self.view.addSubview(button)
  • using Storyboard or XIB

previewpreview

2  (Optional) 按钮属性设置

   btn.checkLineWidth = 6.0
   btn.progressBorderWidth  = 5.0
   btn.successColor = UIColor(red:0, green:206/255, blue:148/255, alpha:1)
   btn.progressColor = UIColor(red:0, green:206/255, blue:148/255, alpha:1)

3 (Optional) 按钮statechanged回调

  btn1.stateChanged = {
            (toState:SubmitButtonState) in
            if toState == .Loading {                self.btn1.progress  = 1
            }
  }

4 改变按钮状态

@IBAction func btnClicked(sender: AnyObject) {        let btn = sender as! SubmitButton        if btn.submitState != .Normal  {
            btn.changeState(.Normal)

        } else {
            btn.changeState(.Loading)
        }
    }

5 设置进度

  ...
   btn.progress = 1
  ...

本文地址:https://www.codercto.com/soft/d/6300.html

Introduction to Graph Theory

Introduction to Graph Theory

Douglas B. West / Prentice Hall / 2000-9-1 / USD 140.00

For undergraduate or graduate courses in Graph Theory in departments of mathematics or computer science. This text offers a comprehensive and coherent introduction to the fundamental topics of graph ......一起来看看 《Introduction to Graph Theory》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具