Quiero dibujar una línea en la celda de vista de tabla para poder colocar el campo de texto & cambiar en una sola celda. Aumenté la altura de la celda. ¿Cómo puedo dibujar una línea en la celda?Draw Line usando CGContext
tengo subclase de UIView que contiene siguiente código
//Get the CGContext from this view
CGContextRef context = UIGraphicsGetCurrentContext();
//Set the stroke (pen) color
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
//Set the width of the pen mark
CGContextSetLineWidth(context, 1.0);
// Draw a line
//Start at this point
CGContextMoveToPoint(context, 10.0, 30.0);
//Give instructions to the CGContext
//(move "pen" around the screen)
CGContextAddLineToPoint(context, 310.0, 30.0);
//Draw it
CGContextStrokePath(context);
Entonces tengo una tableViewController con el estilo de tabla agrupada. En cellForRowAtIndexPath tengo el siguiente código
//code to add textfield
DrawLineView *drawLine = [[DrawLineView alloc]init];
[cell addSubview:drawLine];
//code add switch
Pero no está dibujando ninguna línea. No puedo usar 2 celdas diferentes Tengo que ayudarme por favor. Esta es la primera vez que trato con los gráficos en el iPhone. Gracias
gracias por la respuesta. Pero no está funcionando. – iOSAppDev