GMStepper, 中间有一个滑动标签的步进器

分享于 

4分钟阅读

GitHub

  繁體 雙語
A stepper with a sliding label in the middle.
  • 源代码名称:GMStepper
  • 源代码网址:http://www.github.com/gmertk/GMStepper
  • GMStepper源代码文档
  • GMStepper源代码下载
  • Git URL:
    git://www.github.com/gmertk/GMStepper.git
    Git Clone代码到本地:
    git clone http://www.github.com/gmertk/GMStepper
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/gmertk/GMStepper
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    GMStepper

    VersionLicensePlatform

    中间带有滑动标签的步进器。 平移标签或者点击按钮。 查看教程,如何构建自定义的步进部件 1.

    屏幕截图

    Screenshot_1.gif

    用法

    GMStepper可以通过 CocoaPods 获得。 要安装它,只需将以下几行添加到你的Podfile:

    use_frameworks!
    pod "GMStepper"

    设置

    如果你想使用 Storyboard,只需将UIView放入 Storyboard 并将它的类设置为 GMStepper。 然后通过属性检查器自定义。 否则,你可以编写代码以使用框架初始化,并设置属性。

    属性

    /// Current value of the stepper. Defaults to 0.var value:Double=0/// Minimum value. Must be less than maximumValue. Defaults to 0.var minimumValue:Double=0/// Maximum value. Must be more than minimumValue. Defaults to 100.var maximumValue:Double=100/// Step/Increment value as in UIStepper. Defaults to 1.var stepValue:Double=1/// The same as UIStepper's autorepeat. If true, holding on the buttons or keeping the pan gesture alters the value repeatedly. Defaults to true.var autorepeat:Bool=true/// If the value is integer, it is shown without floating point.var showIntegerIfDoubleIsInteger:Bool=true/// Text on the left button. Be sure that it fits in the button. Defaults to"-".var leftButtonText:String="-"/// Text on the right button. Be sure that it fits in the button. Defaults to"+".var rightButtonText:String="+"/// Text color of the buttons. Defaults to whitevar buttonsTextColor: UIColor = UIColor.whiteColor()/// Background color of the buttons. Defaults to dark blue.var buttonsBackgroundColor: UIColor =UIColor(red:0.21, green:0.5, blue:0.74, alpha:1)/// Font of the buttons. Defaults to AvenirNext-Bold, 20.0 points in size.var buttonsFont =UIFont(name: "AvenirNext-Bold", size: 20.0)/// Text color of the middle label. Defaults to white.var labelTextColor: UIColor = UIColor.whiteColor()/// Text color of the middle label. Defaults to lighter blue.var labelBackgroundColor: UIColor =UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)/// Font of the middle label. Defaults to AvenirNext-Bold, 25.0 points in size.var labelFont =UIFont(name: "AvenirNext-Bold", size: 25.0)/// Corner radius of the middle label's layer. Defaults to 0.0.var labelCornerRadius: CGFloat =0.0/// Corner radius of the stepper's layer. Defaults to 4.0.var cornerRadius: CGFloat =4.0/// Border width of the stepper and middle label's layer. Defaults to 0.0.var borderWidth: CGFloat =0.0/// Color of the border of the stepper and middle label's layer. Defaults to clear color.var borderColor: UIColor = UIColor.clearColor()/// Percentage of the middle label's width. Must be between 0 and 1. Defaults to 0.5. Be sure that it is wide enough to show the value.var labelWidthWeight: CGFloat =0.5/// Color of the flashing animation on the buttons in case the value hit the limit.var limitHitAnimationColor: UIColor =UIColor(red:0.26, green:0.6, blue:0.87, alpha:1)

    作者

    许可证

    GMStepper在MIT许可证下可用。 有关详细信息,请参阅许可证文件。


    sli  STEP  Sliding  
    相关文章