一、系統內置顏色 app
//無色 cell.selectionStyle = UITableViewCellSelectionStyleNone; //藍色 cell.selectionStyle = UITableViewCellSelectionStyleBlue; //灰色 cell.selectionStyle = UITableViewCellSelectionStyleGray;
二、 字體
改變UITableViewCell選中時背景色:
spa
UIColor *color = [[UIColoralloc]initWithRed:0.0green:0.0blue:0.0alpha:1];//經過RGB來定義本身的顏色 code
cell.selectedBackgroundView = [[[UIView alloc] initWithFrame:cell.frame] autorelease]; cell.selectedBackgroundView.backgroundColor = [UIColor xxxxxx];3自定義UITableViewCell選中時背景
cell.selectedBackgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cellart.png"]] autorelease]; 還有字體顏色 cell.textLabel.highlightedTextColor = [UIColor xxxcolor]; [cell.textLabel setTextColor:color];//設置cell的字體的顏色
[theTableView setSeparatorColor:[UIColor xxxx ]];
五、設置cell中字體的顏色 it
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(0 == indexPath.row) { cell.textLabel.textColor = ...; cell.textLabel.highlightedTextColor = ...; } }