Salut tout le monde j'ai fait un UITableView dans mon application et quand une cellule est touchée, elle élargit le problème que je suis, il ne s'effondre pas, peu importe ce que j'ai essayé, je suis sûr que c'est quelque chose comprendre le seul moment où il s'effondre est quand une autre cellule est engagée.effondrement un UITableView
Voici mon code:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
selectedCellIndexPath = indexPath;
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
if (selectedCellIndexPath) {
selected = YES;
}
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(selectedCellIndexPath != nil
&& [selectedCellIndexPath compare:indexPath] == NSOrderedSame)
return 150;
return 44;
}
Vérifiez le lien suivant: - http://stackoverflow.com/questions/8657502/expandable-tableview/8697503#8697503 –