Próbuję rozwinąć UITableViewCell, aby odsłonić więcej treści. Póki co mam animację, ale mój problem polega na tym, że nowa zawartość pojawia się przed ukończeniem animacji. Oto mój kod:Rozszerzanie UITableViewCell
ps Etykieta opisu i przycisk odczytu rozpoczynają się jako ukryte, gdy komórka jest skonfigurowana.
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
self.selectedRow = indexPath;
SDJCell *cell = (SDJCell *)[tableView cellForRowAtIndexPath:indexPath];
[tableView beginUpdates];
[tableView endUpdates];
cell.descriptionLabel.hidden = NO;
cell.readButton.hidden = NO;
}
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
SDJCell *cell = (SDJCell *)[tableView cellForRowAtIndexPath:indexPath];
[tableView beginUpdates];
[tableView endUpdates];
cell.descriptionLabel.hidden = YES;
cell.readButton.hidden = YES;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if(selectedRow && indexPath.row == selectedRow.row) {
return 100;
}
return 44;
}
Jakieś pomysły na to, w jaki sposób mogę ujawnić tę dodatkową zawartość po wykonaniu komórki rozszerzającej?
Dzięki!
jesteś człowiekiem dzięki –
Czy miałeś przypadkiem znaleźć sposób, aby zmniejszyć komórkę z powrotem na drugim kontakcie? Próbuję znaleźć sposób na cofnięcie efektu. –
Tak, po prostu ustaw wysokość z powrotem na minimalną wysokość i powinno to zrobić. – aryaxt