THCircularProgressView.h 的使用方法
//
// MainViewController.m
// fitmiss
//
// Created by bill on 13-4-11.
// Copyright (c) 2013年 lear. All rights reserved.
// #import "MainViewController.h"
#import "RootTabBarController.h"
#import "MLNavigationController.h"
#import "THCircularProgressView.h"
#import "Function.h" #import "textViewController.h" @interface MainViewController () @property (nonatomic, strong) NSTimer *timer;
@property (nonatomic) CGFloat percentage;
@property (nonatomic) CGFloat percentageEnd;
@property (nonatomic) THCircularProgressView *roundProgressBar; @end @implementation MainViewController -(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated]; self.percentage = ;
self.percentageEnd = 0.75;
self.timer = [NSTimer scheduledTimerWithTimeInterval:0.01
target:self
selector:@selector(timerFired:)
userInfo:nil
repeats:YES];
} - (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated]; self.roundProgressBar.percentage = ;
[self.timer invalidate];
} - (void)viewDidLoad
{
[super viewDidLoad]; UIView *rootView = [[UIView alloc]init]; rootView.frame = CGRectMake(, , [Function getScreenWidth], [Function getScreenHeight] - );
rootView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:rootView];
//主要区域
UIView *taskView = [[UIView alloc]initWithFrame:CGRectMake(, , [Function getScreenWidth], )];
taskView.backgroundColor = [Function colorWithHexString:@"#f5f0eb"];
[rootView addSubview:taskView]; //添加圆----------------------------------------------------------------
UIView *roundView = [[UIView alloc]initWithFrame:CGRectMake(, , , )];
//添加圆形的进度条
self.percentage = ;
//self.percentageEnd = 1;
self.roundProgressBar = [[THCircularProgressView alloc] initWithCenter:CGPointMake(, )
radius:
lineWidth:88.0f
progressMode:THProgressModeFill
progressColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"round_show"]]
progressBackgroundMode:THProgressBackgroundModeCircumference
progressBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"round_bg"]]
percentage:self.percentage];
[roundView addSubview:self.roundProgressBar]; //添加圆的按钮及上面的文字
UIImage *roundButtonImg = [UIImage imageNamed:@"round_button"];
UIButton *roundButton = [UIButton buttonWithType:UIButtonTypeCustom];
roundButton.frame = CGRectMake(, , roundButtonImg.size.width, roundButtonImg.size.height);
[roundButton setBackgroundImage:roundButtonImg forState:UIControlStateNormal];
UILabel *buttonLabel = [[UILabel alloc] initWithFrame:CGRectMake(, , , )];
buttonLabel.backgroundColor = [UIColor clearColor];
buttonLabel.text = @"";
buttonLabel.textAlignment = ;
buttonLabel.shadowColor = [UIColor grayColor];
buttonLabel.shadowOffset = CGSizeMake(0.5,0.5);
buttonLabel.textColor = [Function colorWithHexString:@"#3f3f3f"];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) {
buttonLabel.font = [UIFont fontWithName:@"Avenir Next Condensed" size:70.0f];
}else{
buttonLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:60.0f];
}
[roundButton addTarget:self action:@selector(renwuButtenClick:) forControlEvents:UIControlEventTouchUpInside];
[roundButton addSubview:buttonLabel]; UILabel *buttonLabelTop = [[UILabel alloc] initWithFrame:CGRectMake(, , , )];
buttonLabelTop.backgroundColor = [UIColor clearColor];
buttonLabelTop.text = @"未完成任务";
buttonLabelTop.textAlignment = ;
buttonLabelTop.textColor = [Function colorWithHexString:@"#555555"];
buttonLabelTop.font = [UIFont systemFontOfSize:];
[roundButton addSubview:buttonLabelTop]; UILabel *buttonLabelButtom = [[UILabel alloc] initWithFrame:CGRectMake(, , , )];
buttonLabelButtom.backgroundColor = [UIColor clearColor];
buttonLabelButtom.text = @"点击执行";
buttonLabelButtom.textAlignment = ;
buttonLabelButtom.textColor = [Function colorWithHexString:@"#555555"];
buttonLabelButtom.font = [UIFont systemFontOfSize:];
[roundButton addSubview:buttonLabelButtom]; [roundView addSubview:roundButton];
//---------------------------------------------------------------------
[taskView addSubview:roundView]; } - (void)timerFired:(NSTimer *)timer
{
self.percentage += 0.01;
if (self.percentage >= self.percentageEnd) {
[self.timer invalidate];
} self.roundProgressBar.percentage = self.percentage; } @end
THCircularProgressView.h 的使用方法的更多相关文章
- SecureCRT中某些命令提示符下按Backspace显示^H的解决方法
SecureCRT中某些命令提示符下按Backspace显示^H的解决方法 安装了Apache Derby数据库服务器之后,使用ij客户端去连接derby服务端,可是在ij中输入命令的时候,每当输入错 ...
- 关于 apue.h 的使用方法
unix中有很多地方使用到apue.h .apue.h是作者自己写的一个头文件,这个文件怎么用,晚上有很多方法,但是经过尝试大多不好用. 经过本人尝试,可以把src.3e.tar.gz 的代码解压到 ...
- 关于【cocos2dx-3.0beta-制作flappybird】教程在3.2project中出现找不到CCMenuItem.h的解决方法
文章原文:http://blog.csdn.net/kantian_/article/details/36187141 作者升级源码.能够在3.1平台下执行. 我的是vs2013+cocos2dx-3 ...
- VS2013/2012 下无法打开 源 文件“stdafx.h”的解决方法
VS2013/2012下代码一写上去保存就报错了,下方提示无法打开 源 文件“stdafx.h” 如图: 百度了一下,对于VS2010有这样的方法可以解决: 在项目属性中展开C/C++,选择常规,在附 ...
- C/C++:多个.cpp文件包括同一个.h头文件定义方法
本文解决multiple definition of `XX'的错误.[出于反爬虫的目的,你不是在http://blog.csdn.net/zhanh1218上看到的,肯定不是最新最全的.] 关于头文 ...
- secureCRT使用退格键(backspace)出现^H解决的方法
刚新装了python-3.4.1,使用secureCRT连接上去,可是我在进入后,输入回格键时,屏幕显示的是^H,这个让人受不了.最终在网上找到了解决的方法,仅仅要改动一下secureCRT的配置就可 ...
- caffe.pb.h丢失问题解决方法
https://blog.csdn.net/ThomasCai001/article/details/53940430 错误提示 fatal error: caffe/proto/caffe.pb ...
- 有关linux中,<math.h>的调用方法
h{font-weight:bold;color:green;font-size:105%} p{font-size:100%} linux下C语言程序中,若要用到math.h中的函数(如:sin() ...
- 使用ASIHTTPRequest 编译提示找不到"libxml/HTMLparser.h"的解决方法
使用ASIHTTPRequest xcode编译提示找不到"libxml/HTMLparser.h",解决方法如下: 1>.在xcode中左边选中项目的root节点,在中间编 ...
随机推荐
- AudioUnit,AudioQueue之争
最近在修改调试一个webrtc的问题,困扰了好久,故先记录下来,有成果了就发出来.问题1 使用webrtc源码做iOS上的VOIP通讯时(iOS侧接口用的AudioUnit),如果通话中被CS域来电打 ...
- 【渗透测试学习平台】 web for pentester -2.SQL注入
Example 1 字符类型的注入,无过滤 http://192.168.91.139/sqli/example1.php?name=root http://192.168.91.139/sqli/e ...
- Ansible安装配置及使用
一.Ansible特点 1.不需要安装客户端,通过sshd通信 2.基于模块工作,模块可以由任何序言开发 3.不仅支持命令行使用模块,也支持编写yaml格式的playbook 4.支持sudo 5.有 ...
- Android--解析XML之SAX
前言 既然要说XML解析,那么先来聊聊什么是XML.XML,可扩展标记语言 (Extensible Markup Language) ,用于标记电子文件使其具有结构性的标记语言,可以用来标记数据.定义 ...
- P168 实战练习(构造方法)
尝试编写一个矩形类,将长宽做为矩形类的属性,在构造方法中将长宽初始化,定义一个成员方法求此矩形的面积. 编写代码如下: 创建Rectangular类,则相关代码为: package org.hanqi ...
- Visual Studio 2012 离线升级包的制作
通过CMD执行“VS2012.3.exe/layout”命令,就可以把在线升级的文件保存到本地,这样一来,只要把下载出来的文件打包上传,然后分享出去,所谓的“VS2012 Update 3 离线升级包 ...
- java定时框架:表达式设置
Quartz中时间表达式的设置-----corn表达式 (注:这是让我看比较明白的一个博文,但是抱歉,没有找到原作者,如有侵犯,请告知) 时间格式: <!-- s m h d m w(?) y( ...
- mave之:java的web项目必须要的三个jar的pom形式
jsp-api javax.servlet-api jstl <!-- jsp --> <dependency> <groupId>javax.servlet< ...
- Redis 源码解析
http://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness- ...
- NoSQL之Redis高级实用命令详解--安全和主从复制
Android IOS JavaScript HTML5 CSS jQuery Python PHP NodeJS Java Spring MySQL MongoDB Redis NOSQL Vim ...