- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, rect);
//上分割线,
CGContextSetStrokeColorWithColor(context,SET_COLOR(225,225, 225).CGColor);
CGContextStrokeRect(context, CGRectMake(0, -0.5, rect.size.width,0.5));
//下分割线
CGContextSetStrokeColorWithColor(context, SET_COLOR(225,225, 225).CGColor);
CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width,0.5));
}
这是一个方法,直接在继承与UItableViewCell的类中声明,就可以了,,简单明了