https://github.com/YouXianMing

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

 

posted @ 2014-06-21 09:53  YouXianMing  阅读(522)  评论(0编辑  收藏  举报