iphone - How to remove CGContext for line in ios? -
i moving , adding lines these 2 lines.
cgcontextmovetopoint(context, 20, 185); cgcontextaddlinetopoint(context, 20, 185);
i want know how can remove line (like cgcontextaddlinetopoint(context, 20, 185); //addline). want remove line when move or clear line color if array == 2;
then line color clear color or line remove position when moved forward.
any idea or suggestion highly welcome.
as long in drawrect:
method, can draw line if needs , not if want clear it. drawrect:
method gets called many times , view "cleared" before start drawing. code might this:
- (void)drawrect:(cgrect)rect { // other drawing code , declaration of array variable... if ([array count] == 2) { cgcontextmovetopoint(context, 20, 185); cgcontextaddlinetopoint(context, 20, 185); } }
Comments
Post a Comment