В разных разделах может быть разное фоновое изображение и разные рамки для подпредставлений.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"];
if(cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"LOC_ID"];
[cell autorelease];
}
if(indexPath.section == 0){
if(indexPath.section == 0 && [self tableView:numberOfRowsInSection:0]-1 == indexPath.section){
//put background image for last row in section 0
} else {
//backgroundimaes for all other cells in section0
} else if(indexPath.section == 1) {
//configure section 1 ibackgroundimages
}
}
return cell;
}
установка фона ячейки
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_bg.png" ]autorelease];
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_selected_bg.png"];