(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Get a table cell
UITableViewCell *cell = [tableView dequeueReusableCellForIdentifier:@"cell"];
// Set up the table cell
cell.textLabel.text = @"This is a table cell.";
// If you're targeting iOS 6, set the label's background color to clear
// This must be done BEFORE changing the layer's backgroundColor
cell.textLabel.backgroundColor = [UIColor clearColor];
// Set layer background color
cell.textLabel.layer.backgroundColor = [UIColor blueColor].CGColor;
return cell;
}
中国人 要具有分享精神,出自
http://stackoverflow.com/questions/2965085/uitableviewcell-makes-labels-background-clear-when-highlighted