标签: iphone core-graphics
我有2个CGPoints,并希望在它们之间绘制直线,我该怎么做?
答案 0 :(得分:6)
CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextMoveToPoint(ctx, point1.x, point1.y); CGContextAddLineToPoint(ctx, point2.x, point2.y); CGContextStrokePath(ctx);