tableViewcell中的时间线
来源:互联网 发布:大数据岗位 编辑:程序博客网 时间:2024/06/09 20:11
在自定义的cell中:
-(void)drawRect:(CGRect)rect{
NSLog(@"cell的绘制");
//画圆
[self drawCircle:CGPointMake(rect.size.width/2, rect.size.height/2) radius:6.0];
//划线
[self drawLine:rect];
}
-(void)drawLine:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
//边缘样式
CGContextSetLineCap(context, kCGLineCapRound);
// 线的宽度
CGContextSetLineWidth(context, 2);
CGContextSetAllowsAntialiasing(context, true);
//线的颜色
CGContextSetRGBStrokeColor(context, 255, 0, 0, 1.0);
CGContextBeginPath(context);
//起点
CGContextMoveToPoint(context, 12, 0);
//终点坐标
CGContextAddLineToPoint(context, 12, rect.size.height);
CGContextStrokePath(context);
}
//画圆
-(void)drawCircle:(CGPoint)center radius:(float)radius{
//一个不透明类型的Quartz 2D绘画环境,相当于一个画布,你可以在上面任意绘画
CGContextRef context = UIGraphicsGetCurrentContext();
/*画圆*/
UIColor*aColor = [UIColor colorWithRed:1 green:0.0 blue:0 alpha:1];
CGContextSetFillColorWithColor(context, aColor.CGColor);//填充颜色
CGContextSetLineWidth(context, 0.1);//线的宽度
CGContextAddArc(context, 12, center.y, radius, 0, 2*PI, 0);
//添加一个圆
//kCGPathFill填充非零绕数规则,kCGPathEOFill表示用奇偶规则,kCGPathStroke路径,kCGPathFillStroke路径填充,kCGPathEOFillStroke表示描线,不是填充
CGContextDrawPath(context, kCGPathFillStroke); //绘制路径加填充
}
- tableViewcell中的时间线
- iOS---点击tableviewcell中的按钮
- ios 设置tableViewcell中的图片大小
- tableviewcell
- tableViewcell
- tableViewCell
- tableViewCell
- TableViewCell
- 取得tableViewCell中的任意一个cell
- tableviewcell中的badged TDBadgedCell 的实现
- TableViewCell中.m中的执行顺序
- iOS 在TableViewCell中的UIImageView调整大小
- tableViewCell的线左对齐
- iOS TableViewCell 底下线显示不全解决方案
- 获取tableviewCell在当前屏幕中的坐标值
- ios 7 自定义tableviewcell中的lable自适应高度
- iOS之ios8中TableViewCell中的短线不能居中问题
- iOS 选择tableViewCell中的控件确定cell位置
- MySQL中LIKE子句与排序
- Android Training - 管理应用的内存
- Android计时器Chronometer小例子
- Mapper类/Reducer类中的setup方法和cleanup方法以及run方法的介绍
- 【网络流24题】飞行员配对方案问题
- tableViewcell中的时间线
- android实践项目七自定义的Spinner
- ScrollView 嵌套 ListView,进入界面不在顶部
- php算法之选择排序
- C语言08字符串 & 预处理 & 结构体
- 第八周项目1——(2)数组做数据成员
- fzu2223
- MicroERP开发技术分享:技术选型
- zlib剖析(四)