ASProgressPopUpView

ASProgressPopUpView-LMLPHP

https://github.com/alskipp/ASProgressPopUpView

效果:

ASProgressPopUpView-LMLPHP

-使用-

将源码拖入工程当中:

ASProgressPopUpView-LMLPHP

//
// 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(, , , )]; // 设置字体
_progressView1.font = [UIFont fontWithName:@"HelveticaNeue-Thin"
size:.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()%/.f
animated:YES];
} timeInterval:NSEC_PER_SEC];
[_timer start];
} @end

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

ASProgressPopUpView-LMLPHP

这个方法还没用过:

ASProgressPopUpView-LMLPHP

TextLayer

ASProgressPopUpView-LMLPHP

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

ASProgressPopUpView-LMLPHP

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

05-18 04:41