//
// 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. js实现分页列表添加样式

    <script> var dUrl=window.location.href; var cUrl=(dUrl.substring(0, dUrl.indexOf('list_'))); v ...

  2. <转>windows下安装redis

    1.redis简介redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(so ...

  3. UVa 1388 - Graveyard

    题意:有一个周长为10000的圆上等距分布着n个雕塑,现在又加入m个雕塑,位置随意,希望n+m个雕塑仍然均匀分布.这就要移动其中一些雕像,求移动的最小距离. 这个题的方法很巧妙,首先将整个圆分成(m+ ...

  4. meta标签兼容性

    基本标签SEO 优化为移动设备添加 viewportWindows 8其他 禁止数字识自动别为电话号码不让android识别邮箱每 8 秒刷新一次页面移动端的头部标签和meta 基本标签 声明文档使用 ...

  5. iOS平台网络类型检测

    老大新增个需求,连接服务器时要区分内外网,需求理解了,现实很骨感啊,没办法,干. #import <Foundation/Foundation.h> /* 依赖于以下Framework S ...

  6. Websphere发布时遇到的问题

    在发布时遇到了data source配置的问题,搞了好久没搞定,最后问题出现在 JDBC providers那边,Implementation class name 改成: com.ibm.db2.j ...

  7. spark-DataFrame之RDD和DataFrame之间的转换

    package cn.spark.study.core.mycode_dataFrame; import java.io.Serializable;import java.util.List; imp ...

  8. Android——计算器

    layout文件: <?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:andr ...

  9. JS/JQuery控制图片宽度

    function changeImgWidth(){ for (i = 0; i <$('#info img').length; i++) { var imgWidth=$('#info img ...

  10. Unity Shader _Time

    _Time是个4维向量,跟Unity3D中的deltaTime(这是个一维的,数值)不同. float4 _Time : Time (t/20, t, t*2, t*3), use to animat ...