1. 程式人生 > >tableView的取消選中狀態方法

tableView的取消選中狀態方法

ARVR技術交流qq群602929993

#pragma mark tableView的取消選中狀態的兩個方法

裡面什麼也不用寫

-(void)setSelected:(BOOL)selected animated:(BOOL)animated

{

}

-(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated

{

}

以前用上面那種方法就可以 今天發現不好使了.只能另設定了

    cell.selectionStyle =UITableViewCellSelectionStyleNone;

//反選點選的時候灰色返回來的時候又變回白色

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    [tableView deselectRowAtIndexPath:indexPathanimated:YES];

}