- 浏览: 236681 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
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 741引用 主题:xcode 6制作动态&静态库 连接:ht ... -
ios 错误合集(updated!)
2015-01-09 11:57 797引用 错误:dyld: Library not loaded ... -
几个不错的xcode插件
2014-09-11 13:33 63291、代码补全插件 http://alcatraz.io 2、 ... -
xcode 插件目录
2014-09-11 13:14 456~/Library/Application\ Suppor ... -
GCD 倒计时
2014-08-19 10:00 1008-(void)startTime{ __bloc ... -
Eventkit使用案例
2014-02-15 16:06 3202- (void)createNewEventAndNewR ... -
ios 应用内跳转到系统设置界面的最好写法
2013-04-24 11:43 10164如下是跳转到系统设置诸多界面的url prefs:roo ... -
beeframework "___gxx_personality_sj0", referenced from:错误解决
2013-04-17 13:50 1840到Bee_Precompile.h 找到如下一行: #de ... -
pod update/install git pull 443错误解决
2013-01-22 18:38 2350自从12306.cn抢票插件搞爆github服务器以后,我就再 ... -
[转]如何编写一个CocoaPods的spec文件
2012-12-27 16:25 14308本文转自http://ishalou.com/blog/201 ... -
[转]How to use NSAttributedString in iOS 6
2012-12-25 16:09 2618本文转自:http://soulwithmobiletechn ... -
mac上的小工具(updated)
2012-12-24 18:05 1020mac上显示隐藏文件的命令,如果要隐藏则 -bool fals ... -
github README.md 编辑技巧小结 (updated)
2012-12-18 11:39 20691.文字连接 [文字](http://ace.ajax.org ... -
iOS 怎样更方便使用第三方框架
2012-11-29 12:45 1610管理第三方库越来越成为每个程序员的基本工作,因为每次都要去加入 ... -
CocoaPods:管理 Objective-C 專案裡頭各種 Library 關聯性最棒的方式
2012-11-26 14:53 1041介绍: 开发应用的时候第三方的库是不可缺少的,它能提高开发的 ... -
转载:用HTML5/CSS3/JS开发Android/IOS应用框架大全
2012-11-22 15:16 1262现在,用js调用本地代码已经不是一件新鲜事,已经有成熟的库来做 ... -
core data 分页查询
2012-11-07 11:26 1534NSFetchRequest *request = [[N ... -
[转]从Flurry导出数据
2012-10-17 10:51 1182有时我们需要一些详细 ... -
AFNetworking multipart upload
2012-10-12 14:52 5434+ (NSDictionary*)parametersOf ... -
IOS openssl rsa encrypt/decrypt
2012-09-29 15:15 6383对OpenSSL RSA加解密的封 ...
相关推荐
本资源"(0102)-iOS/iPhone/iPAD/iPod源代码-选项卡(Tab Bar)-Custom TabBarController"主要探讨了如何自定义Tab Bar,使其符合应用程序的个性化需求。下面将详细介绍自定义Tab Bar的相关知识点。 1. **...
【Trello custom progress bar-crx插件】是一个针对Trello平台的第三方扩展程序,它允许用户自定义Trello卡片上的进度条样式,从而提供更加个性化和视觉吸引力的项目管理体验。这款插件专为那些寻求超越Trello默认...
将Youtube:trade_mark:进度条更改为来自有趣收藏的自定义。让你的Youtube:trade_mark:播放器真棒! 让Youtube播放器的进度条搞笑又酷! 从大型集合中为进度条选择一个主题,它将适用于YouTube上的所有视频。...
本文将深入探讨如何在iPhone、iPad或iPod Touch应用中创建一个具有圆形设计并显示动态进度条的按钮,即"Round Progress Button"。这个特性常见于音乐播放应用,如iTunes,它在用户预览歌曲时展示当前的播放进度。 ...
在iOS开发中,Progress Bar是一种常见的UI元素,用于显示任务的进度或加载状态。这个"效果很炫的progress bar"源码提供了一种创新且吸引用户的进度条实现方式,能够提升应用的用户体验。下面我们将深入探讨这个源码...
CoverFlow for iPhone now supports devices with a custom screen size (iPad / PC version of the Safari browser). What's New in Prior Releases? Take a look at Studio for iPhone's release history to ...
在`res/layout`目录下,创建一个名为`custom_progress_bar.xml`的文件,并添加以下代码: ```xml xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/custom_progress_bar" style=...
ProgressBar progressBar = findViewById(R.id.custom_progress_bar); progressBar.setProgress(50); // 设置当前进度为50% ``` 此外,`android-square-progressbar`还支持多种动画效果,比如平滑的渐进动画,可以...
This repo contains translations of the app Custom Navigation Bar on Google Play. Feel free contact me at paphonb@gmail.com if you want to help translating the app to your language.
【标题】"OfficeCustomUIEditorFiles_CustomUI_MicrosoftOffice_" 提到的是一个与 Microsoft Office 自定义用户界面(Custom UI)编辑器相关的文件集合。这个工具主要用于帮助用户自定义 Office 应用程序,如 Word、...
After hours of “googling” I found some solutions, how to show progress bar in DataGridView object so I decided to create my own custom progress bar column. Articles I found, served as a guide for ...
@ ramonak / react-progress-bar 进度栏React组件(使用Typescript构建) 安装 npm install --save @ramonak/react-progress-bar 用法 import React from "react" ; import ProgressBar from "@ramonak/react-...
Office Custom UI Editor是一款专为Microsoft Office 2007设计的工具,旨在帮助用户自定义其界面,特别是针对2007版本中的 Ribbon 用户界面。Ribbon 是Office 2007引入的一项重大改变,它将传统的菜单和工具栏转换为...
LabVIEW Tools is new for iphone and andriod. The Data Dashboard for LabVIEW app lets you create a custom dashboard that can remotely control and monitor running NI LabVIEW applications. This is done ...
CustomUIEditor 是一种工具,用于创建和编辑 Microsoft Office 的自定义用户界面。通过 CustomUIEditor,用户可以自定义 Office 应用程序的功能区、菜单和工具栏,以满足特定的需求。这样可以提高用户的工作效率,使...
标题 "Stylish-Custom-themes-for-any-website_v1.8.3.rar" 提供了一个关于自定义网站主题的扩展程序,版本为1.8.3。这个扩展程序允许用户为他们访问的任何网站定制样式,从而改变浏览器的视觉体验。其中,“Stylish...
4. **自定义进度条(Custom Progress Bar)** 自定义进度条允许开发者创建独特的加载效果。这通常涉及创建自定义的布局和动画。例如,`customloading`这个文件可能包含了一个自定义加载效果的实现。开发者可以使用`...