android仿ios进度条,仿iOS7圆形蓝色进度条 – FFCircularProgressView

该项目是一款仿照iOS 7 的蓝色圆形进度条视图。

QRZVRn.png

6363ye.png

动态图

NZRzEv.gif

安装方式

CocoaPods

1.将 pod ‘FFCircularProgressView’, ‘>= 0.1’ ?添加到你的Podfile中

2.运行 pod install ?安装pod

3.在你的项目中需要的地方import进程视图‘#import “FFCircularProgressView.h”’

手动添加

手动将源文件添加到你的项目中。你需要的文件是 ‘FFCircularProgressView.h’, ‘FFCircularProgressView.m’, ‘UIColor+iOS7.h’, ‘UIColor+iOS7.m’。

使用方法

把本项目当做一个正常的UIProgressView来使用。确保你在主要线程设置过进程值。

double delayInSeconds = 2.0;

dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));

dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND,0), ^{

for (float i=0; i<1.1; i+=0.01F) {

dispatch_async(dispatch_get_main_queue(), ^{

[circularProgressView setProgress:i];

});

usleep(10000);

}

});

});

还可以使用以下两种方法来启动和停止旋转从而控制进度视图旋转动画:

// Start spinning

[circularProgressView startSpinProgressBackgroundLayer];

// Stop spinning

[circularProgressView stopSpinProgressBackgroundLayer];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值