23Cell的重用
- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier
//ios6
- (id)dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath NSMutableSet* _cacheCells;
NSMutableDictionary* _visibleCellsMap;- (DZTableViewCell*) _cellForRow:(NSInteger)rowIndex
{
DZTableViewCell* cell = [_visibleCellsMap objectForKey:@(rowIndex)];
if (!cell) {
cell = [_dataSource dzTableView:self cellAtRow:rowIndex];
DZCellActionItem* deleteItem = [DZCellActionItem buttonWithType:UIButtonTypeCustom];
deleteItem.backgroundColor = [UIColor redColor];
[deleteItem addTarget:self action:@selector(deleteCellOfItem:) forControlEvents:UIControlEventTouchUpInside];
[deleteItem setTitle:@"删除" forState:UIControlStateNormal];
deleteItem.edgeInset = UIEdgeInsetsMake(0, 10, 0, 260);
DZCellActionItem* editItem = [DZCellActionItem buttonWithType:UIButtonTypeCustom];
editItem.edgeInset = UIEdgeInsetsMake(0, 80, 0, 180);
editItem.backgroundColor = [UIColor greenColor];
[editItem setTitle:@"编辑" forState:UIControlStateNormal];
[editItem addTarget:self action:@selector(editCellOfItem:) forControlEvents:UIControlEventTouchUpInside];
cell.actionsView.items = @[deleteItem,editItem ];
}
return cell;
}已经在界面上的cell
没有在界面上的cell
DZTableView 可重用cell的cache
DZTableViewCell相关
Last updated
