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的绝好教材.

  • 相关阅读:
    《软件需求十步走》阅读笔记一
    《探索需求》读书笔记三
    2018.9.26 随笔
    2018.9.09 随笔
    日期随笔,目录
    2018.9.03 随笔
    linux signal函数遇到的问题
    关于子线程执行两次的问题
    本科四年的一点经验
    linux 网络编程 3---(io多路复用,tcp并发)
  • 原文地址:https://www.cnblogs.com/YouXianMing/p/3800621.html
Copyright © 2011-2022 走看看