设置tableview选中行的背景色

来源:互联网 发布:淘宝外卖是什么平台 编辑:程序博客网 时间:2024/04/28 05:51

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

{

    //设置为透明色

    [self.lookOverTableViewcellForRowAtIndexPath:indexPath].selectionStyle

 = UITableViewCellSelectionStyleNone;

    //设置为蓝色

    [self.lookOverTableView cellForRowAtIndexPath:indexPath].selectionStyle

 = UITableViewCellSelectionStyleBlue;

    //设置为灰色

    [self.lookOverTableView cellForRowAtIndexPath:indexPath].selectionStyle 

 = UITableViewCellSelectionStyleGray;

}