系統(tǒng)默認(rèn)的顏色
//無(wú)色cell.selectionStyle =UITableViewCellSelectionStyleNone;
UITableViewCellSelectionStyleBlue;
UITableViewCellSelectionStyleGray;
自定義顏色背景
改變UITableViewCell選中時(shí)背景色:UIColor*color = [[UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//通過(guò)RGB來(lái)定義自己的顏色[html] view plaincopycell.selectedBackgroundView = [[UIViewalloc] initWithFrame:cell.frame ];? ? ? cell.selectedBackgroundView.backgroundColor = [UIColorxxxxxx];
自定義UITableViewCell選中背景
cell.selectedBackgroundView =? [[UIImageViewalloc] initWithImage:[UIImageimageNamed:@"cellart.png"]];// 還有字體顏色cell.textLabel.highlightedTextColor = [UIColorxxxcolor];//設(shè)置cell的字體的顏色[cell.textLabel setTextColor:color];
4.設(shè)置tableViewCell間的分割線的顏色
[theTableView setSeparatorColor:[UIColorxxxx ]];
5褐桌、設(shè)置cell中字體的顏色
// Customize the appearance of table view cells.- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{if(0== indexPath.row)? {? ? cell.textLabel.textColor = ...;? ? cell.textLabel.highlightedTextColor = ...;? }? ...}