`- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = (UITableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"CellIdentifier"];
if (nil==cell)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(0,0,0,0)] autorelease];
cell.contentView.backgroundColor=CLEAR_COLOR;
//Configure cell format for the tableView,
//Same format for all the three sections.
int tagCount = 1;
CGFloat lXCoord = 5,lYCoord = 7,lWidth = 100/*,lHeight = 18*/;
// for (tagCount = 1; tagCount <= 1; tagCount++) {
UILabel *lUILabel = [[UILabel alloc]init];
lUILabel.frame = CGRectMake(lXCoord+10, 0, lWidth, 34);
lUILabel.backgroundColor = [UIColor clearColor];
lUILabel.textColor = RGB_A(35, 30, 32, 1);
lUILabel.highlightedTextColor=WHITE_COLOR;
lUILabel.font = FONT_OPENSANS_REGULAR(14);
[cell.contentView addSubview:lUILabel];
[lUILabel setTag:tagCount];
RELEASE_NIL(lUILabel);
// }
UIImageView *lUIImageView = [[UIImageView alloc]init];
lUIImageView.frame = CGRectMake(lXCoord+100, lYCoord, 45, 29);
[lImageView_ setHighlightedImage:[UIImage imageNamed:[NSString stringWithFormat:@"iPad_BuildInspectionDetails_%@_Selected.png",[[mDamageTableArray_ objectAtIndex:0] objectAtIndex:indexPath.row]]]];
[lImageView_ setImage:[UIImage imageNamed:[NSString stringWithFormat:@"iPad_BuildInspectionDetails_%@_Normal.png",[[mDamageTableArray_ objectAtIndex:0] objectAtIndex:indexPath.row]]]];
cell.accessoryView=lUIImageView;
[lUIImageView setTag:tagCount + 1];
RELEASE_NIL(lUIImageView);
UIView *lSelectedView_ = [[[UIView alloc] init] autorelease];
lSelectedView_.backgroundColor =SELECTED_CELL_COLOR_GM;
cell.selectedBackgroundView = lSelectedView_;
}
//cell.accessoryType=UITableViewCellAccessoryNone;
return cell;
}
- Note :-
Use setHighlightedImage property for UIImageView `enter code here`& highlightedTextColor for UILabel.
you can see highlighted image and highlighted text color if you select a row in UITableView
This will help you.
Happy Coding...`