//
// 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 的使用方法的更多相关文章

  1. SecureCRT中某些命令提示符下按Backspace显示^H的解决方法

    SecureCRT中某些命令提示符下按Backspace显示^H的解决方法 安装了Apache Derby数据库服务器之后,使用ij客户端去连接derby服务端,可是在ij中输入命令的时候,每当输入错 ...

  2. 关于 apue.h 的使用方法

    unix中有很多地方使用到apue.h  .apue.h是作者自己写的一个头文件,这个文件怎么用,晚上有很多方法,但是经过尝试大多不好用. 经过本人尝试,可以把src.3e.tar.gz 的代码解压到 ...

  3. 关于【cocos2dx-3.0beta-制作flappybird】教程在3.2project中出现找不到CCMenuItem.h的解决方法

    文章原文:http://blog.csdn.net/kantian_/article/details/36187141 作者升级源码.能够在3.1平台下执行. 我的是vs2013+cocos2dx-3 ...

  4. VS2013/2012 下无法打开 源 文件“stdafx.h”的解决方法

    VS2013/2012下代码一写上去保存就报错了,下方提示无法打开 源 文件“stdafx.h” 如图: 百度了一下,对于VS2010有这样的方法可以解决: 在项目属性中展开C/C++,选择常规,在附 ...

  5. C/C++:多个.cpp文件包括同一个.h头文件定义方法

    本文解决multiple definition of `XX'的错误.[出于反爬虫的目的,你不是在http://blog.csdn.net/zhanh1218上看到的,肯定不是最新最全的.] 关于头文 ...

  6. secureCRT使用退格键(backspace)出现^H解决的方法

    刚新装了python-3.4.1,使用secureCRT连接上去,可是我在进入后,输入回格键时,屏幕显示的是^H,这个让人受不了.最终在网上找到了解决的方法,仅仅要改动一下secureCRT的配置就可 ...

  7. caffe.pb.h丢失问题解决方法

    https://blog.csdn.net/ThomasCai001/article/details/53940430 错误提示   fatal error: caffe/proto/caffe.pb ...

  8. 有关linux中,<math.h>的调用方法

    h{font-weight:bold;color:green;font-size:105%} p{font-size:100%} linux下C语言程序中,若要用到math.h中的函数(如:sin() ...

  9. 使用ASIHTTPRequest 编译提示找不到"libxml/HTMLparser.h"的解决方法

    使用ASIHTTPRequest xcode编译提示找不到"libxml/HTMLparser.h",解决方法如下: 1>.在xcode中左边选中项目的root节点,在中间编 ...

随机推荐

  1. VundleVim的安装与使用

    git:https://github.com/VundleVim/Vundle.vim vundle是一款vim编辑器的插件管理软,用起来很方便的原因有几点: 1)只要知道插件名称,就能搜索到并下载安 ...

  2. 纯 CSS 创建一个三角形

    [要求]:用纯CSS创建一个三角形的原理是什么? ♪ 答: 把上.左.右三条边隐藏掉(颜色设为 transparent) [实现]: #demo { width: 0; height: 0; bord ...

  3. 《JS高程》实现继承的6种方式(完整版)

    许多OO语言都支持 两种继承方式: (1)接口继承:只继承方法签名: (2)实现继承:继承实际的方法. ECMAScript 由于函数没有签名,无法实现接口继承,因此只支持实现继承,而且主要是依靠原型 ...

  4. SVM学习笔记

    一.SVM概述 支持向量机(support vector machine)是一系列的监督学习算法,能用于分类.回归分析.原本的SVM是个二分类算法,通过引入“OVO”或者“OVR”可以扩展到多分类问题 ...

  5. JavaScript 编写多线程代码引用Concurrent.Thread.js(转)

    这是一个很简单的功能实现: <script type="text/javascript" src="Concurrent.Thread.js">&l ...

  6. HDU 3555 数位dp

    Bomb Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submi ...

  7. 使用Jsoup函数包抓取网页内容

    之前写过一篇用Java抓取网页内容的文章,当时是用url.openStream()函数创建一个流,然后用BufferedReader把这个inputstream读取进来.抓取的结果是一整个字符串.如果 ...

  8. C++ Primer : 第十章 : 泛型算法 之 lambda表达式和bind函数

    一.lambda表达式 lambda表达式原型: [capture list] (parameter list) -> retrue type { function body } 一个lambd ...

  9. html部分---通用标签与属性;

    body的属性: bgcolor页面背景色:text文字颜色:topmargin上页边距:leftmargin左页边距:rightmargin右页边距:bottomargin下页边距: src是引用过 ...

  10. leetcode 143. Reorder List ----- java

    Given a singly linked list L: L0→L1→-→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→- You must do thi ...