2013年8月27日 星期二

UITableViewCell deselect 取消選取


有沒有遇到過UITableViewCell 按下去之後就一直有呈現選擇的狀態

只在didSelectRowAtIndexPath加上

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

    // Your code here ...  
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

 }


就可以了喔 

animated YES的話會有藍色選取被漸淡的動畫