Cómo cambiar el color de fondo de las etiquetas integradas en uitableviewcell usando código
1. Configuración de color predeterminada del sistema
[cpp] ver copia simple
// Sin color
celda. SelectionStyle = UITableViewCellSelectionStyleNone
// azul
cell.selectionStyle = UITableViewCellSelectionStyleBlue
// gris
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// Azul
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
// Gris
cell.selectionStyle = UITableViewCellSelectionStyleNone
// Gris p>
2.SelectionStyle = UITableViewCellSelectionStyleGray;
2 Personaliza la configuración de color y fondo
Cambia el color de fondo de UITableViewCell cuando está seleccionado: <. /p>
UIColor *color = [[ UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//Defina su propio color a través de RGB
[html] ver copia simple p>
cell .selectedBackgroundView = [[[UIView alloc] initWithFrame:cell.frame] autorelease];
cell.selectedBackgroundView.textLabel.highlightedTextColor = [UIColor xxxcolor]; color];// Configuración El color de la fuente en la celda
4. Establezca el color de la línea separadora entre tableViewCell
[theTableView setSeparatorColor:[UIColor xxxx]];
5. Establecer el color de la fuente en la celda
//Personalizar la apariencia de las celdas de la vista de tabla.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(0 == indexPath.row)
{
cell.textLabel.textColor = ... ;
cell.textLabel.highlightedTextColor = ... ;
}
...
}