[CPP]View PlainCopy
- 1. System default color settings
[CPP]View PlainCopy
- Colorless
- Cell.selectionstyle = Uitableviewcellselectionstylenone;
- Blue
- Cell.selectionstyle = Uitableviewcellselectionstyleblue;
- Grey
- Cell.selectionstyle = Uitableviewcellselectionstylegray;
2. Custom color and background settings
Change UITableViewCell background color When selected:
Uicolor *color = [[uicoloralloc]initwithred:0.0Green:0.0Blue: 0.0Alpha:1]; Use RGB to define your own colors
[HTML]View PlainCopy
- Cell.selectedbackgroundview = [[[UIView alloc] initWithFrame:cell.frame] autorelease];
- Cell.selectedBackgroundView.backgroundColor = [Uicolor xxxxxx];
3 Custom UITableViewCell Background When selected
[HTML]View PlainCopy
- Cell.selectedbackgroundview = [[[Uiimageview alloc] initwithimage:[uiimage imagenamed:@ "Cellart.png"]] autorelease];
- and a font color.
- Cell.textLabel.highlightedTextColor = [Uicolor Xxxcolor]; [Cell.textlabel settextcolor:color];//sets the color of the cell's font
4. Set the color of the split line between Tableviewcell
[Thetableview Setseparatorcolor:[uicolor xxxx]];
5. Set the color of the font in the cell
Customize The appearance of Table view cells.- (UITableViewCell *)TableView:(UITableView *)TableView Cellforrowatindexpath:(Nsindexpath *)Indexpath{ if (0 == Indexpath.) { cell textlabel.= ...; cell.. Highlightedtextcolor = ...; } ... } /span>
UITableViewCell background color. Check background color, split line, font color settings