我正在尝试扩展 UITableViewCell 以显示更多内容。到目前为止,我已经完成了动画,但我的问题是新内容在动画完成之前出现。这是我的代码:
ps 在配置单元格时,描述标签和阅读按钮都以隐藏状态开始。
-(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;
}
关于在单元格完成扩展后如何显示这些额外内容的任何想法?
谢谢!!