ios - Drawing a line on a UIScrollview -


i trying draw line indicate current time on scrollview (day planner).

i believe issue path not valid because taking current views context , not actual size of scrollview content size. if make currenttime float smaller value smaller draw line.

float currenttime = ([components hour] * 60) + [components minute];      uigraphicsbeginimagecontextwithoptions(self.scrollview.contentsize,no,0.0);     uibezierpath *path = [uibezierpath bezierpathwithrect:cgrectmake(0, currenttime, self.scrollview.frame.size.width, currenttime)];      cashapelayer *shapelayer = [[cashapelayer alloc] init];     [shapelayer setframe:self.scrollview.frame];     [shapelayer setpath:[path cgpath]];     [shapelayer setstrokecolor:[[uicolor redcolor] cgcolor]];     [shapelayer setmaskstobounds:yes];     [self.scrollview.layer addsublayer:shapelayer]; 


Comments