static NSString *SimpleTableIdntifier =@"SimpleTableIdentifier";
UITableViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:SimpleTableIdntifier];
if (cell==nil) {
>UITableViewCellalloc] initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:SimpleTableIdntifier]autorelease];
>UIViewalloc]initWithFrame:cell.frame]autorelease];
>UIColorredColor];
>UITableViewCellAccessoryDisclosureIndicator;
}
NSArray *array = [dataListobjectAtIndex:indexPath.section];
cell.textLabel.text = [arrayobjectAtIndex:indexPath.row];
return>
=========================================
UIView *tempView = [[[UIViewalloc] init] autorelease];
[cell setBackgroundView:tempView];
[cell setBackgroundColor:[UIColorclearColor]];
本文介绍如何在iOS开发中使用UITableView的dequeueReusableCellWithIdentifier方法来实现单元格的复用,包括单元格的基本配置、背景设置等。
1万+

被折叠的 条评论
为什么被折叠?



