0

次のような矢印を描きたいと思います。

ここに画像の説明を入力

CGPoint を使用してこのようなことを行うにはどうすればよいですか?

4

1 に答える 1

0

UIView サブビューの -drawRect メソッドで:

CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(ctx, point1.x, point1.y);
CGContextAddLineToPoint(ctx, point2.x, point2.y);
CGContextAddLineToPoint(ctx, point3.x, point3.y);
CGContextAddLineToPoint(ctx, point1.x, point1.y);
CGContextClosePath(context);
CGContextStrokePath(ctx);
于 2012-08-01T21:14:37.330 に答える