tableView里选中一行cell其它不选中的方法

Posted nocrash

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tableView里选中一行cell其它不选中的方法相关的知识,希望对你有一定的参考价值。

方法1:

#pragma mark--选中状态

 

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

    GASSelectNextTableViewCell *cell = (GASSelectNextTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];

    cell.selectedBtn.selected  = YES;

    

    }

-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {

    GASSelectNextTableViewCell *cell = (GASSelectNextTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];

    cell.selectedBtn.selected  = NO;

 

}

方法2:

1.定义一个全局的Button

2.然后让他选中

以上是关于tableView里选中一行cell其它不选中的方法的主要内容,如果未能解决你的问题,请参考以下文章