我正在重新使用 Apple 的AdvancedTableViewCells示例来创建自定义的快速滚动表格视图。具体来说,我正在使用他们的CompositeSubviewBasedApplicationCell方法在 tableviewcell 上绘制内容drawRect
一切正常,但是如何使用他们的方法隐藏标签或设置标签或图像的标签?这样做对我来说很新(没有 IB),所以如果这很容易,我提前道歉。
设置单元格内容的代码是:
- (void)drawRect:(CGRect)rect
{
[_cell.animalIcon drawAtPoint:CGPointMake(5.0, 5.0)];
[_cell.animalName drawAtPoint:CGPointMake(93.0, 25.0)];
_highlighted ? [[UIColor whiteColor] set] : [[UIColor colorWithWhite:0.23 alpha:1.0] set];
[_cell.animalDescription drawAtPoint:CGPointMake(100.0, 54.0) withFont:[UIFont boldSystemFontOfSize:13.0]];
[_cell.animalNameString drawAtPoint:CGPointMake(93.0, 5.0) withFont:[UIFont boldSystemFontOfSize:13.0]];
}