- 浏览: 238714 次
- 性别:
- 来自: 北京
-
文章分类
最新评论
-
lanzhiyuan:
楼主还混这里不?NSData *data = [NSURLCo ...
[转] 为UIWebView实现离线浏览 -
hyc4117:
#define OpenSSLRSAPublicKeyFile ...
IOS openssl rsa encrypt/decrypt -
guogongjun:
确实有效,不错,感谢啦大神
[转]安装openfire后admin无法登录管理控制平台 -
xiongyoudou1:
怎么办,而且你那下载的demo和你讲解的不是一样
[转] 为UIWebView实现离线浏览 -
xiongyoudou1:
有问题。执行到方法NSData *data = [NSURLC ...
[转] 为UIWebView实现离线浏览
Posted by NaveenShan on Wednesday, November 3, 2010 Under: iPhone/iPad
Call for Custom Progress Bar.
First, Implement the above code as new File
And Call like following,
From:http://www.naveenshan.yolasite.com/blog/custom-slider-for-iphone-ipad
/************************************************************************************** /* File Name : ProgressBar.h /* Project Name : <nil> Generic /* Description : A Custom Progress Bar View /* Version : 1.0 /* Created by : Naveen Shan /* Created on : 13/10/10 /* Copyright (C) 2010 RapidValue IT Services Pvt. Ltd. All Rights Reserved. /**************************************************************************************/ #import <UIKit/UIKit.h> @interface ProgressBar : UIView { float minValue, maxValue; float currentValue; UIColor *lineColor, *progressRemainingColor, *progressColor, *textColor; } @property (readwrite) float minValue, maxValue, currentValue; @property (nonatomic, retain) UIColor *lineColor, *progressRemainingColor, *progressColor, *textColor; -(void)setNewRect:(CGRect)newFrame; @end
/************************************************************************************** /* File Name : ProgressBar.m /* Project Name : <nil> Generic /* Description : N/A /* Version : 1.0 /* Created by : Naveen Shan /* Created on : 13/10/10 /* Copyright (C) 2010 RapidValue IT Services Pvt. Ltd. All Rights Reserved. /**************************************************************************************/ #import "ProgressBar.h" @implementation ProgressBar #pragma mark - @synthesize minValue, maxValue, currentValue; @synthesize lineColor, progressRemainingColor, progressColor, textColor; #pragma mark - - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { minValue = 0; maxValue = 1; currentValue = 0; self.backgroundColor = [UIColor clearColor]; lineColor = [[UIColor whiteColor] retain]; textColor = [[UIColor magentaColor] retain]; progressColor = [[UIColor darkGrayColor] retain]; progressRemainingColor = [[UIColor lightGrayColor] retain]; } return self; } #pragma mark - - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetLineWidth(context, 3); CGContextSetStrokeColorWithColor(context,[lineColor CGColor]); //upper half CGContextSetFillColorWithColor(context, [[progressRemainingColor colorWithAlphaComponent:.7] CGColor]); CGContextAddRect(context, CGRectMake(2, 2, rect.size.width-4, ((rect.size.height/2)-2))); CGContextFillPath(context); //lower half CGContextSetFillColorWithColor(context, [progressRemainingColor CGColor]); CGContextAddRect(context, CGRectMake(2, rect.size.height/2-2, rect.size.width-4, ((rect.size.height/2)-2))); CGContextFillPath(context); //border CGContextAddRect(context, CGRectMake(0, 0, rect.size.width, rect.size.height-2)); CGContextStrokePath(context); //to plot progress float amount = (currentValue/(maxValue - minValue)) * (rect.size.width-5); CGContextSetFillColorWithColor(context, [progressColor CGColor]); CGContextAddRect(context, CGRectMake(2,2, amount, rect.size.height-5)); CGContextFillPath(context); //to draw percentage text CGContextSetFillColorWithColor(context, [textColor CGColor]); CGContextSelectFont(context, "Helvetica", rect.size.height/2, kCGEncodingMacRoman); CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1.0, -1.0)); CGContextSetTextDrawingMode(context, kCGTextFill); char str[20]; sprintf(str, "%d %s" ,(int)currentValue,"%"); CGContextShowTextAtPoint(context,((rect.size.width/2)-10),rect.size.height/2,str,strlen(str)); } -(void)setNewRect:(CGRect)newFrame { self.frame = newFrame; [self setNeedsDisplay]; } #pragma mark - -(void)setMinValue:(float)newMin { minValue = newMin; [self setNeedsDisplay]; } -(void)setMaxValue:(float)newMax { maxValue = newMax; [self setNeedsDisplay]; } -(void)setCurrentValue:(float)newValue { if(newValue < minValue) currentValue = minValue; else if(newValue > maxValue) currentValue = maxValue; else currentValue = newValue; [self setNeedsDisplay]; } #pragma mark - -(void)setLineColor:(UIColor *)newColor { [newColor retain]; [lineColor release]; lineColor = newColor; [self setNeedsDisplay]; } -(void)setTextColor:(UIColor *)newColor { [newColor retain]; [textColor release]; textColor = newColor; [self setNeedsDisplay]; } -(void)setProgressColor:(UIColor *)newColor { [newColor retain]; [progressColor release]; progressColor = newColor; [self setNeedsDisplay]; } -(void)setProgressRemainingColor:(UIColor *)newColor { [newColor retain]; [progressRemainingColor release]; progressRemainingColor = newColor; [self setNeedsDisplay]; } #pragma mark - - (void)dealloc { [lineColor release]; [textColor release]; [progressColor release]; [progressRemainingColor release]; [super dealloc]; }
Call for Custom Progress Bar.
First, Implement the above code as new File
And Call like following,
ProgressBar *objProgressBar= [[ProgressBar alloc] initWithFrame:CGRectMake(100,100,600,75)]; objProgressBar.maxValue=100.0; objProgressBar.minValue=0.0; objProgressBar.lineColor=[UIColor redColor]; objProgressBar.textColor=[UIColor magentaColor]; objProgressBar.progressColor=[UIColor greenColor]; objProgressBar.progressRemainingColor=[UIColor blueColor]; objProgressBar.currentValue=10.0; [self.view addSubview:objProgressBar]; [objProgressBar release];
From:http://www.naveenshan.yolasite.com/blog/custom-slider-for-iphone-ipad
- ProgressBar.zip (1.8 KB)
- 下载次数: 10
发表评论
-
ios 开发技术
2015-01-09 11:59 767引用 主题:xcode 6制作动态&静态库 连接:ht ... -
ios 错误合集(updated!)
2015-01-09 11:57 824引用 错误:dyld: Library not loaded ... -
几个不错的xcode插件
2014-09-11 13:33 63901、代码补全插件 http://alcatraz.io 2、 ... -
xcode 插件目录
2014-09-11 13:14 482~/Library/Application\ Suppor ... -
GCD 倒计时
2014-08-19 10:00 1034-(void)startTime{ __bloc ... -
Eventkit使用案例
2014-02-15 16:06 3242- (void)createNewEventAndNewR ... -
ios 应用内跳转到系统设置界面的最好写法
2013-04-24 11:43 10207如下是跳转到系统设置诸多界面的url prefs:roo ... -
beeframework "___gxx_personality_sj0", referenced from:错误解决
2013-04-17 13:50 1867到Bee_Precompile.h 找到如下一行: #de ... -
pod update/install git pull 443错误解决
2013-01-22 18:38 2389自从12306.cn抢票插件搞爆github服务器以后,我就再 ... -
[转]如何编写一个CocoaPods的spec文件
2012-12-27 16:25 14350本文转自http://ishalou.com/blog/201 ... -
[转]How to use NSAttributedString in iOS 6
2012-12-25 16:09 2655本文转自:http://soulwithmobiletechn ... -
mac上的小工具(updated)
2012-12-24 18:05 1067mac上显示隐藏文件的命令,如果要隐藏则 -bool fals ... -
github README.md 编辑技巧小结 (updated)
2012-12-18 11:39 21151.文字连接 [文字](http://ace.ajax.org ... -
iOS 怎样更方便使用第三方框架
2012-11-29 12:45 1643管理第三方库越来越成为每个程序员的基本工作,因为每次都要去加入 ... -
CocoaPods:管理 Objective-C 專案裡頭各種 Library 關聯性最棒的方式
2012-11-26 14:53 1070介绍: 开发应用的时候第三方的库是不可缺少的,它能提高开发的 ... -
转载:用HTML5/CSS3/JS开发Android/IOS应用框架大全
2012-11-22 15:16 1300现在,用js调用本地代码已经不是一件新鲜事,已经有成熟的库来做 ... -
core data 分页查询
2012-11-07 11:26 1564NSFetchRequest *request = [[N ... -
[转]从Flurry导出数据
2012-10-17 10:51 1224有时我们需要一些详细 ... -
AFNetworking multipart upload
2012-10-12 14:52 5472+ (NSDictionary*)parametersOf ... -
IOS openssl rsa encrypt/decrypt
2012-09-29 15:15 6427对OpenSSL RSA加解密的封 ...
相关推荐
苹果公司最早于2007年1月9日的Macworld大会上公布这个系统,最初是设计给iPhone使用的,后来陆续套用到iPod touch、iPad以及Apple TV等苹果产品上。iOS与苹果的Mac OS X操作系统一样,它也是以Darwin为基础的,因此...
街道级行政区划shp矢量数据,wgs84坐标系,下载直接使用
街道级行政区划shp数据,wgs84坐标系,直接下载使用。
街道级行政区划shp矢量数据,wgs84坐标系,下载直接使用
轻量级密码算法LBlock的FPGA优化实现.docx
街道级行政区划shp矢量数据,wgs84坐标系,下载直接使用
Git 资料 progit-zh-v2.1.1.pdf
街道级行政区划shp数据,wgs84坐标系,直接下载使用。
篮球计分器FPGA附程序..doc
街道级行政区划shp数据,wgs84坐标系,直接下载使用。
内容概要:本文档全面介绍了Linux开发的基础知识、应用场景、环境搭建、常用命令、Shell脚本编程以及C/C++和Python开发等内容。首先阐述了Linux开发的重要性及其在服务器端开发、嵌入式开发和系统运维等领域的广泛应用。接着详细讲解了如何选择合适的Linux发行版并安装系统,配置开发环境,包括安装必要的开发工具和配置SSH服务。文档还深入讲解了Linux基础命令,如文件和目录操作、文件内容查看与编辑、进程管理和权限管理。此外,介绍了Shell脚本编程的基本语法,包括变量、条件语句、循环语句和函数定义。针对C/C++和Python开发,文档分别讲解了编译器安装、程序编写与编译、调试方法及使用虚拟环境等内容。最后,简要介绍了Linux内核开发的相关知识,包括下载编译内核、内核模块开发等,并推荐了相关学习资源。 适合人群:对Linux开发感兴趣的初学者及有一定经验的研发人员,尤其是希望深入掌握Linux开发技能的开发者。 使用场景及目标:①掌握Linux开发环境的搭建与配置;②熟悉Linux基础命令和Shell脚本编程;③学习C/C++和Python在Linux下的开发流程;④了解Linux内核开发的基本概念和技术。 阅读建议:此文档内容丰富,涵盖面广,建议读者根据自身需求选择性阅读,并结合实际操作进行练习。特别是对于初学者,应先掌握基础命令和开发环境的搭建,再逐步深入到编程语言和内核开发的学习。
街道级行政区划shp数据,wgs84坐标系,直接下载使用。
街道级行政区划shp数据,wgs84坐标系,直接下载使用。
街道级行政区划shp数据,wgs84坐标系,直接使用。
内容概要:本文档《word练习题.docx》是一份详细的Word操作练习指南,涵盖了从基础到高级的各种功能。文档分为三个主要部分:内容编辑、页面布局和高效文档。内容编辑部分包括文本格式化、段落设置、项目编号、制表位、边框与底纹等练习;页面布局部分涉及分节符、分栏、页眉页脚、水印等设置;高效文档部分则聚焦于样式管理、导航窗格、题注、书签、超级链接、脚注与尾注、交叉引用等功能。每个练习都有具体的操作步骤,帮助用户掌握Word的各种实用技巧。 适合人群:适用于Word初学者及希望提高Word技能的中级用户,尤其是需要频繁使用Word进行文档编辑和排版的办公人员。 使用场景及目标:①帮助用户熟悉Word的基本操作,如文本编辑、格式设置等;②提升用户的文档排版能力,学会设置复杂的页面布局;③提高工作效率,掌握高效文档管理技巧,如样式应用、题注和交叉引用等。 其他说明:此文档不仅提供了具体的练习题目,还附带了详细的步骤说明,用户可以根据指引逐步完成每个练习。此外,文档中的一些练习涉及到智能文档和Office智能客户端的应用,有助于用户了解Word在企业级应用中的潜力。建议用户按照章节顺序逐步学习,实践每一个练习,以达到最佳的学习效果。
街道级行政区划shp数据,wgs84坐标系,直接下载使用。
全球腐败感知数据(2000-2023)——3000行 33个指标 关于数据集 该数据集包含3000行和33列,涵盖了2000年至2023年的腐败感知指数(CPI)数据和各种治理指标。它包括国家排名、分数和其他指标,如公共部门腐败、司法腐败、贿赂指数、商业道德、民主指数、法治、政府效率、经济指标和人类发展指数。 这些数据可用于: 腐败趋势分析 腐败对GDP、人类发展指数和治理的影响 跨国比较 数据可视化和机器学习模型 该数据集对研究人员、数据分析师、政策制定者和对研究全球腐败趋势非常有用。
毕业设计(论文) 基于FPGA的数字频率计设计.doc
街道级行政区划shp数据,wgs84坐标系,直接使用。