在UITableView的Delegate方法裏寫上:spa
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath3d
{orm
cell.selectionStyle = UITableViewCellSelectionStyleDefault;//先選擇默認的選擇樣式
it
cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame];io
cell.selectedBackgroundView.backgroundColor =[UIColor redColor](自定義的顏色);table
}select