Ios UITableView-开始更新/结束更新动画设置

Ios UITableView-开始更新/结束更新动画设置,ios,objective-c,uitableview,uiview,uianimation,Ios,Objective C,Uitableview,Uiview,Uianimation,我正在构建一个UITableView,其中的单元格在选中时会“滑出”下面的附加视图。为此,我使用[tableview BeginUpdate]和[tableview endUpdates]为表格视图中的行高度设置了动画,然后设置滑动视图的动画,以便与该动画一起平移,使其看起来像被揭开一样。我使用的动画效果相当好,但与行高度的移动方式有点不同 例如,这是我的手机。通常,仅显示白色部分(由于高亮显示而为蓝色),但如果选择一行,灰色视图将从底部滑出,就像该行的操作菜单一样,带有两个按钮: 我想知道的

我正在构建一个
UITableView
,其中的单元格在选中时会“滑出”下面的附加视图。为此,我使用
[tableview BeginUpdate]
[tableview endUpdates]
为表格视图中的行高度设置了动画,然后设置滑动视图的动画,以便与该动画一起平移,使其看起来像被揭开一样。我使用的动画效果相当好,但与行高度的移动方式有点不同

例如,这是我的手机。通常,仅显示白色部分(由于高亮显示而为蓝色),但如果选择一行,灰色视图将从底部滑出,就像该行的操作菜单一样,带有两个按钮:

我想知道的是:默认情况下,表视图的
BeginUpdates
/
EndUpdates
方法使用的动画设置是什么,或者如果不知道,是否可以将它们设置为自定义的,以便我的行高和滑动视图的动画设置完全相同

tableView
方法:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if ([[tableView indexPathForSelectedRow] isEqual:indexPath])
        return CellHeightAlternate;
    return CellHeightNormal;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    SlideOutViewTableViewCell *newCell  = (SlideOutViewTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];

    [tableView beginUpdates];
    [tableView endUpdates];

    [newCell showView];
}
- (void)showView{
    [self.slideoutView setFrame:CGRectMake(self.slideoutView.frame.origin.x, 40, self.slideoutView.frame.size.width, self.slideoutView.frame.size.height)];
    [UIView animateWithDuration:.25 animations:^{
        [self.slideoutView setFrame:CGRectMake(self.slideoutView.frame.origin.x, 70, self.slideoutView.frame.size.width, self.slideoutView.frame.size.height)];

    }];
}
SlideOutattableViewCell
showView方法:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if ([[tableView indexPathForSelectedRow] isEqual:indexPath])
        return CellHeightAlternate;
    return CellHeightNormal;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    SlideOutViewTableViewCell *newCell  = (SlideOutViewTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];

    [tableView beginUpdates];
    [tableView endUpdates];

    [newCell showView];
}
- (void)showView{
    [self.slideoutView setFrame:CGRectMake(self.slideoutView.frame.origin.x, 40, self.slideoutView.frame.size.width, self.slideoutView.frame.size.height)];
    [UIView animateWithDuration:.25 animations:^{
        [self.slideoutView setFrame:CGRectMake(self.slideoutView.frame.origin.x, 70, self.slideoutView.frame.size.width, self.slideoutView.frame.size.height)];

    }];
}

所以我通过反复试验找到了答案:


表格视图更改行高的动画(来自
[tableview BeginUpdate]
[tableview EndUpdate]
方法)是一个持续时间为.3秒的线性动画(无动画效果)。

对不起,我什么都不懂。另外,为什么您在没有任何内容的情况下使用
[tableView beginUpdates]
[tableView endUpdates]
?@MatteoGobbi我从这个问题中得到了代码:。如果它们之间没有任何差异,它仍会调用单元格上的重画,并在选择其他单元格时设置在
-tableView:heightforrowatinexpath:
中发生的更改的动画