How can i get pan gestures for drawn line?

KolaMounikaKolaMounika USMember ✭✭✭


I have one issue in my sample that is , i am able to draw lines on screen now and then i am adding those lines to another UIView as subview by below code

    var shapeLayer = new CAShapeLayer();

    shapeLayer.Path = new CGPath();

    shapeLayer.Path.AddLines(new CGPoint[] { initioalPoint, latestPoint });

    shapeLayer.StrokeColor = UIColor.Blue.CGColor;

    shapeLayer.LineWidth = (System.nfloat)3.0;

    shapeLayer.FillColor = UIColor.Clear.CGColor;

    var subView = new UIView();


    subView.Frame = new CGRect(0,0,600,1500);

    var mainView = new UIView();


with this code i am showing line on view and also able to drag & drop but

    subView.Frame = new CGRect(0,0,600,1500);

frame height and width allowing me to drag out of drawn line :neutral:

Can anyone tell me, how can i set dynamic height & width for view based on line drawn by user ?


Sign In or Register to comment.