0
我使用此代碼畫一個圓圈內的形狀:繪製一個UIImageView IOS
CGContextRef contextRef = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(contextRef, 2.0);
CGContextSetStrokeColorWithColor(contextRef, [color CGColor]);
CGRect circlePoint = (CGRectMake(coordsFinal.x, coordsFinal.y, 50.0, 50.0));
CGContextStrokeEllipseInRect(contextRef, circlePoint);
圓是我的UIWindow添加,但我希望它在一個UIImageView添加,保持相同的座標UIWindow,所以如果座標超出了UIImageView的大小,圓圈將不會被看到。在UIImageView中,在視圖上簡單地繪製圓。