- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self)
{
self.textLabel.font = [UIFont fontWithName:FontName size:12.f];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
}
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
CGContextFillRect(context, rect);
CGContextSetStrokeColorWithColor(context, kGetColor(200, 200, 200).CGColor);
CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width, 1));
}
- (void) layoutSubviews
{
[super layoutSubviews];
self.imageView.frame = CGRectMake(5, 7.5, 30, 30);
self.textLabel.frame = CGRectMake(40, 0, 200, 45);
}
http://www.open-open.com/lib/view/open1431073736429.html