我們?cè)邳c(diǎn)擊UITableView 的cell時(shí),會(huì)出現(xiàn)陰影,如不做處理,就會(huì)一直顯示,怎么樣讓它點(diǎn)擊之后就消失呢?只要重寫(xiě)UITableView的代理方法,就可以解決,方式如下:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//當(dāng)手指離開(kāi)某行時(shí),就讓某行的選中狀態(tài)消失
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
第二,代碼代碼中修改
UITableViewCell *cell;
......
......
cell.selectionStyle = UITableViewCellSelectionStyleNone;