2013-07-03 74 views

回答

2

可以擴展的UIImageView和方法內畫一條線,像這樣:

public void DrawLine() 
{ 
    CGContext context = UIGraphics.GetCurrentContext(); 
    context.SetLineWidth (4); 
    UIColor.Clear.SetFill(); 
    UIColor.Black.SetStroke(); 
    currentPath = new CGPath(); 
    currentPath.AddLines (points.ToArray()); 
    context.AddPath (currentPath);  
    context.DrawPath (CGPathDrawingMode.Stroke); 
    context.SaveState(); 
} 

點是的PointF對象的名單。

+0

它工作的很好... –