drawRect方法实现进度条progress
来源:互联网 发布:下载隐藏软件 编辑:程序博客网 时间:2024/06/05 02:04
- (void)drawRect:(CGRect)rect {
CGContextRef context=UIGraphicsGetCurrentContext();//获得画图环境
CGContextSetLineWidth(context, 10.0);//线条粗细
CGContextSetStrokeColorWithColor(context, [[UIColor colorWithRed:101.0/255.0 green:144.0/255.0 blue:220.0/255.0 alpha:1.0] CGColor]);//画笔色
CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]);//填充色
CGContextAddArc(context, 100, 100, 20, -M_PI/2.0, endAngle*M_PI-M_PI/2.0, 0);//从最上端开始顺时针画圈
CGContextDrawPath(context, kCGPathFillStroke);
}
- (void)viewDidLoad {
[super viewDidLoad];
ball=[[Ball alloc] initWithFrame:CGRectMake(0.0, 0.0, 200, 200)];
[self.view addSubview:ball];
[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(timerHandler:) userInfo:nil repeats:YES];
}
-(void)timerHandler:(NSTimer*)timer
{
if (ball.endAngle < 1.9) {
ball.endAngle=ball.endAngle+0.1;
}
[ball setNeedsDisplay];
[ball move];
}
- drawRect方法实现进度条progress
- 不用Progress实现进度条显示
- 进度条progress
- Progress进度条
- progress进度条
- iPhone之实现自定义进度条Progress
- iPhone之实现自定义进度条Progress
- VS2013 Progress Control控件实现进度条
- drawRect方法
- drawRect方法
- drawRect方法
- Android在自定义View(SurfaceView)中实现进度条Progress
- ios cocos2d实现progress(进度条)效果控件源码
- Android在自定义View(SurfaceView)中实现进度条Progress
- Android在自定义View(SurfaceView)中实现进度条Progress
- ios cocos2d实现progress(进度条)效果控件源码
- 五,进度条progress
- android Progress进度条使用
- 《设计模式 ● 观察者》之业务场景
- 七款开源ERP评估比较
- Quartz 2D编程指南(1) - 概览
- html5标签参考手册
- Quartz 2D编程指南(2) - 图形上下文(Graphics Contexts)
- drawRect方法实现进度条progress
- 得到linux平台上ssh或ftp用户
- uva 11205 - The broken pedometer
- 学习maven的使用,看到一篇很实用的入门教程(菜鸟级入门)
- 10个重要的算法C语言实现源代码
- windows和unix下定时关机
- JS Float 运算BUG
- Linux下PCI设备驱动程序开发
- Padding和Margin