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节点,在中间编 ...
随机推荐
- Java Servlet——改进的CGI
一.关于Servlet 在上一篇随笔中,我们看到了CGI存在的不足,其每次请求都需加载和运行一个CGI程序.若使用Java编写CGI程序,需要为每个请求都启动一个系统进程以及JVM,其执行效率大大降低 ...
- String的常规使用集合
今天先附上代码君: package com.jacob.javase; import java.io.UnsupportedEncodingException; /* *探讨String: * * ...
- js图片无缝滚动代码
想必大家都注意到<marquee>的不循环滚动,所以出现了很多替代脚本,或iframe或JS输出<marquee>,不管怎么做,都略显麻烦.下面说一下这个相对简单的实现思路:一 ...
- 用无线网络进行Android开发中的调试
1.手机具有root权限 2.安装adbWireless1.5.4.apk (下面有下载地址) 3.敲入命令:adb connect 192.168.1.127 后面是手机的IP地址 打开eclip ...
- Mybatis学习 —— 包括所有 mybatis官网
http://www.mybatis.org/mybatis-3/zh/configuration.html#typeAliases
- poj3249 Test for Job ——拓扑+DP
link:http://poj.org/problem?id=3249 在拓扑排序的过程中进行状态转移,dp[i]表示从起点到 i 这个点所得到的的最大值.比如从u点到v点,dp[v]=max(dp[ ...
- JS初学之-for套for遍历二维数组
<!doctype html><html><head><meta charset="utf-8"><title>无标题文 ...
- python 批量爬取代理ip
import urllib.request import re import time import random def getResponse(url): req = urllib.request ...
- GBG java
https://sourceware.org/gdb/onlinedocs/gdb/Sample-Session.html#Sample-Session http://m.blog.csdn.net/ ...
- solr 主从模式和solrcloud集群模式
主从模式 主节点有单点故障问题:没有主从自动切换,没有failover,主机down掉了的话,整个数据变成只读.并且需要一台机单独做索引,浪费资源,所有数据都需要在这台机器上单独存在一份,索引变化较大 ...