Xet*_*ius 3 iphone cocoa-touch uitableview
我正在尝试创建一个UITableViewCell,它覆盖了内容的完整绘图.我已经覆盖了正在调用的drawRect,但它仍然绘制了默认内容.
如何让它停止绘制默认内容,如何用自己的渲染替换它?
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
DLog (@"Overloaded TableCell initWithStyle");
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
}
return self;
}
- (void)drawRect:(CGRect)rect {
DLog (@"TableCell::drawRect");
// expecting it to draw nothing
}
Run Code Online (Sandbox Code Playgroud)
Loren Brichter(Tweetie的作者)在iTunes U Stanford iPhone编程课程讲座中谈到了这一点.他说通过子类化UITableViewCell并直接绘制每个单元格的内容,他获得了很好的滚动性能结果,并在他关于这个主题的博客文章中给出了一个代码示例.
他还指出,苹果在其中一个代码示例中添加了类似的示例.
| 归档时间: |
|
| 查看次数: |
16205 次 |
| 最近记录: |