zoukankan      html  css  js  c++  java
  • [翻译] SFRoundProgressCounterView 带有进度显示的倒计时视图

    SFRoundProgressCounterView 带有进度显示的倒计时视图

    https://github.com/simpliflow/SFRoundProgressCounterView

    A custom UIView with a rounded progress bar and a counter in the center of the circle. Supports multiple time intervals (in milliseconds), start/stop/resuming counter, set custom color, etc. (see example project)

    一个自定义的UIView,里面有一个圆形的进度条以及中央的一个计数器。支持多种时间格式(支持毫秒),开始,结束,恢复操作,以及自定义颜色。

       

    Setup(开始

    Installing with CocoaPods

    用CocoaPods安装

    If you're unfamiliar with CocoaPods you can check out this tutorial here.

    1. In Terminal navigate to the root of your project.
    2. Run 'touch Podfile' to create the Podfile.
    3. Open the Podfile using 'open -e Podfile'
    4. Add the pod SFRoundProgressCounterView to your Podfile.

      platform :ios, '7.0'
      pod 'SFRoundProgressCounterView'
      
    5. Run pod install.

    6. Open your app's .xcworkspace file to launch Xcode and start using the control!

    Usage(使用

    1. Either create SFRoundProgressCounterView by dragging UIView from storyboard and change implementing class or create it programmatically 创建SFRoundProgressCounterView 
    2. Create an outlet (if create via storyboard) 创建 outlet
    3. Set up time intervals 设置时间间隔

      self.sfProgressCounterView.delegate = self;
      NSNumber* interval = [NSNumber numberWithLong:5000.0];
      self.sfProgressCounterView.intervals = @[interval];
      // you could also define multiple intervals
      //self.sfProgressCounterView.intervals = @[interval, interval, interval];
      
    4. Counter interaction 设置计数器交互

      [self.sfProgressCounterView start];
      [self.sfProgressCounterView stop];
      [self.sfProgressCounterView resume];
      [self.sfProgressCounterView reset];
      
    5. Appearance Settings 外观样式设置

      // thickness of outer circle
      self.sfProgressCounterView.outerCircleThickness = [NSNumber numberWithFloat:3.0];
      
      // thickness of inner circle
      self.sfProgressCounterView.innerCircleThickness = [NSNumber numberWithFloat:1.0];
      
      // track color of outer circle
      self.sfProgressCounterView.innerTrackColor = [UIColor redColor];
      
      // track color of inner circle
      self.sfProgressCounterView.outerTrackColor = [UIColor blackColor];
      
      // distance between two circles (if multiple intervals)
      self.sfProgressCounterView.circleDistance = [NSNumber numberWithFloat:6.0]; 
      
      // set color of outer progress circles
      self.sfProgressCounterView.outerProgressColor = color;
      
      // set color of inner progress circle
      self.sfProgressCounterView.innerProgressColor = color;
      
      // set color of counter label
      self.sfProgressCounterView.labelColor = color;
      

    Delegate Methods(代理方法

        - (void)countdownDidEnd:(SFRoundProgressCounterView*)progressCounterView;
        - (void)intervalDidEnd:(SFRoundProgressCounterView*)progressCounterView WithIntervalPosition:(int)position;
        - (void)counter:(SFRoundProgressCounterView *)progressCounterView didReachValue:(unsigned long long)value;
    

    Author(s)

    Simpliflow GmbH

    Thomas Winkler

  • 相关阅读:
    P2634 [国家集训队]聪聪可可
    P2051 [AHOI2009]中国象棋
    java集成工具的简单总结
    java-web中的web.xml中的servlet和servlet-mapping标签,及网页处理流程
    ecplist中快速添加set get方法
    Spring创建容器之new ClassPathXmlApplicationContext错误
    设计模式之工厂模式
    java-web项目的eclipse里面引入jar包
    DES原理及代码实现
    Linux网络篇,ssh原理及应用
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3674623.html
Copyright © 2011-2022 走看看