摘要: 1 @implementation NJView 2 3 /* 4 -(void)awakeFromNib 5 { 6 7 NSLog(@"awakeFromNib"); 8 // 创建CADisplayLink, 默认每秒60次 9 CADisplayLink *di... 阅读全文
posted @ 2016-01-22 23:41 xiaocaoera 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)drawRect:(CGRect)rect 2 { 3 // Drawing code 4 5 // 画圆, 以便于以后指定可以显示内容范围 6 CGContextRef ctx = UIGraphicsGetCurrentContext();... 阅读全文
posted @ 2016-01-22 22:22 xiaocaoera 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)drawRect:(CGRect)rect 2 { 3 // 画四边形 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 保存上下文 7 CGContextSaveGS... 阅读全文
posted @ 2016-01-22 22:02 xiaocaoera 阅读(418) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)drawRect:(CGRect)rect 2 { 3 // 获取上下文 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 保存一份最纯洁的图形上下文 7 // 调用一次该方法... 阅读全文
posted @ 2016-01-22 18:43 xiaocaoera 阅读(633) 评论(0) 推荐(0) 编辑
摘要: // controllerX,controllerY是弧形起始点的坐标,endX,endY是结束点的坐标CGContextAddQuadCurveToPoint(ctx, controllerX, controllerY, endX, endY); 阅读全文
posted @ 2016-01-22 15:56 xiaocaoera 阅读(269) 评论(0) 推荐(0) 编辑
摘要: // 1.获取上下文 CGContextRef ctx = UIGraphicsGetCurrentContext(); // 2.画饼状图 // 画线 CGContextMoveToPoint(ctx, 100, 100); CGContextAddLineT... 阅读全文
posted @ 2016-01-22 15:27 xiaocaoera 阅读(1067) 评论(0) 推荐(0) 编辑
摘要: 1 // 画圆弧 2 // 1.获取上下文 3 CGContextRef ctx = UIGraphicsGetCurrentContext(); 4 // 2.画圆弧 5 // x/y 圆心 6 // radius 半径 7 // start... 阅读全文
posted @ 2016-01-22 15:23 xiaocaoera 阅读(1193) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)drawRect:(CGRect)rect 2 { 3 4 // 1.获取上下文 5 CGContextRef ctx = UIGraphicsGetCurrentContext(); 6 // 画圆 7 CGContextAddArc(ctx... 阅读全文
posted @ 2016-01-22 15:22 xiaocaoera 阅读(363) 评论(0) 推荐(0) 编辑
摘要: 1 // 1.获取图形上下文 2 CGContextRef ctx = UIGraphicsGetCurrentContext(); 3 4 // 2. 绘制三角形 5 // 设置起点 6 CGContextMoveToPoint(ctx, 10... 阅读全文
posted @ 2016-01-22 15:14 xiaocaoera 阅读(630) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface NJRectView : UIView 4 @end 5 6 7 #import "NJRectView.h" 8 9 @implementation NJRectView10 11 - (void)drawRect:(CGRect)re... 阅读全文
posted @ 2016-01-22 15:13 xiaocaoera 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface NJLineView : UIView 4 @end 5 6 7 #import "NJLineView.h" 8 9 @implementation NJLineView10 11 // 当自定义view第一次显示出来的时候就会调用dr... 阅读全文
posted @ 2016-01-22 15:06 xiaocaoera 阅读(920) 评论(0) 推荐(0) 编辑
摘要: 1 @interface NJTextImage : UIView 2 @end 3 4 5 @implementation NJTextImage 6 7 - (void)drawRect:(CGRect)rect 8 { 9 // [self test];10 // ... 阅读全文
posted @ 2016-01-22 14:47 xiaocaoera 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 1 #import 2 3 @interface NJContatc : NSObject 4 5 @property (nonatomic, copy) NSString *name; 6 @property (nonatomic, copy) NSString *phoneNumber... 阅读全文
posted @ 2016-01-22 00:20 xiaocaoera 阅读(356) 评论(0) 推荐(0) 编辑