2012-03-05 59 views
0

这里是选择了两个蓝色单元格tableView的屏幕截图。如何避免UITableView上的'双选'?

enter image description here 我如何模拟: 我选择一个TableCell的,那么,它推动第二种观点,我回到第一个视图,并选择第二TableCell的,可它会导致此问题。我该如何解决问题?谢谢...

回答

2

去之前第二种观点,取消电池:

[myTableView deselectRowAtIndexPath:indexPath animated:YES]; 
0

看看这个:

- (void)tableView:(UITableView *)tblView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; 
} 

这将这样的伎俩!

0

tableView:didSelectRowAtIndexPath:,叫deselectRowAtIndexPath:animated:

0

您可以在UIViewController试试这个,如果UITableView

- (void)viewWillAppear:(BOOL)animated 
{ 
    [super viewWillAppear:animated]; 

    [tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:YES]; 
}