views:

317

answers:

0

Hi all.

I want to draw some curve in my scroll view using CGPathRef. I tried to draw this path but i see only the part of my CGPathRef which located at 320x480 pixels. Is it way to do that.

Thank you in advance. Here is my code

path = CGPathCreateMutable();

CGContextBeginPath(ctx);
CGContextMoveToPoint(ctx, [[pathArray objectAtIndex:0]CGPointValue].x,[[pathArray         objectAtIndex:0]CGPointValue].y );

for(int i = 1; i < [pathArray count]; ++i)
{
    CGContextAddLineToPoint(ctx, [[pathArray objectAtIndex:i]CGPointValue].x, [[pathArray objectAtIndex:i]CGPointValue].y); 
}
CGContextClosePath(ctx);

CGContextSetRGBFillColor(ctx, 0.5, 0.3, 0.2, 0.5); 
CGContextFillPath(ctx);

And when I scroll my view the line does not change its location. My goal is to move this line during scrolling.