cell点击之后变灰,处理方法

//cell点击之后变灰,处理方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;// 这句话写了就ok了
}
//设置UITableViewCell的选中背景颜色和选中字体颜色的方法
//设置UITableViewCell的选中背景颜色的方法
 
    UIView *view = [[UIView alloc]init];
    view.backgroundColor=[UIColor redColor];
    cell.selectedBackgroundView=view;
 
//设置UITableViewCell的选中字体颜色的方法:
 
cell.selectedTextColor=[UIColor blackColor];//默认显示为白色
 

 

猜你喜欢

转载自huqiji.iteye.com/blog/2239493