zoukankan      html  css  js  c++  java
  • ASProgressPopUpView

    ASProgressPopUpView

    https://github.com/alskipp/ASProgressPopUpView

    效果:

    -使用-

    将源码拖入工程当中:

    //
    //  RootViewController.m
    //  Progress
    //
    //  Copyright (c) 2014年 Y.X. All rights reserved.
    //
    
    #import "RootViewController.h"
    #import "ASPopUpView.h"
    #import "ASProgressPopUpView.h"
    #import "YXGCD.h"
    
    @interface RootViewController ()
    
    @property (nonatomic, strong) ASProgressPopUpView *progressView1;
    @property (nonatomic, strong) ASProgressPopUpView *progressView2;
    @property (nonatomic, strong) GCDTimer            *timer;
    
    @end
    
    @implementation RootViewController
    
    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        _progressView1 = [[ASProgressPopUpView alloc] initWithFrame:CGRectMake(0, 100, 320, 2)];
        
        // 设置字体
        _progressView1.font = [UIFont fontWithName:@"HelveticaNeue-Thin"
                                              size:15.f];
        
        // 设置进度条颜色
        _progressView1.popUpViewAnimatedColors = @[[UIColor redColor],
                                                   [UIColor orangeColor],
                                                   [UIColor greenColor]];
        
        // 显示数值百分比
        [_progressView1 showPopUpViewAnimated:YES];
        [self.view addSubview:_progressView1];
        
        // 定时器
        _timer = [[GCDTimer alloc] initInQueue:[GCDQueue mainQueue]];
        [_timer event:^{
            [_progressView1 setProgress:arc4random()%100/100.f
                               animated:YES];
        } timeInterval:NSEC_PER_SEC];
        [_timer start];
    }
    
    @end

    看了下源码,发现用的是CoreAnimation实现了所有的动画效果,高大上啊.

    这个方法还没用过:

    TextLayer

    这个都不知道是干啥用的.....

    这绝对是学习CoreAnimation的绝好教材.

  • 相关阅读:
    C#中使用ADOMD.NET查询多维数据集
    Expression表达式树
    SqlBulkCopy 批量复制数据到数据表
    字符串、字符、字节以及bit位小结与疑问
    C#系统委托之Action And Func
    C#中委托演变的的三个阶段
    C# 类成员备忘
    C#函数参数
    MongoDB-Getting Started with the C# Driver
    为MongoDB创建一个Windows服务
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3800621.html
Copyright © 2011-2022 走看看