【问题标题】:UITableViewCell flipping animation issue (Grouped style)UITableViewCell 翻转动画问题(分组样式)
【发布时间】:2013-07-05 06:50:12
【问题描述】:

我正在尝试使用答案here 在表格视图中的单元格上做一个翻转动画,它是分组样式的。现在我面临的问题是这个。翻转动画有效。但是单元格周围的边距(这是一个分组表)也与单元格本身一起翻转。

我只希望单元格翻转并且边距保持在那里而不干扰动画。我在这里错过了什么?

链接中的动画代码如下:

-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    [tableView deselectRowAtIndexPath:indexPath : YES ];
    [UIView transitionFromView:[cell.contentView viewWithTag:#tagof view here] toView:checkProjectView duration:1.0f options:UIViewAnimationOptionTransitionFlipFromLeft completion:NULL];
    [UIView commitAnimations];
}

【问题讨论】:

    标签: iphone ios ipad uitableview


    【解决方案1】:

    您应该将 cel 的 contentView 中的所有视图添加到 containerView 中,并且应该将 containerView 添加到单元格的 contentView 并使用该 containerView 进行转换。

    这是最好的方法,因为transitionFromView 方法将在视图层次结构中将fromView 替换为toView,因此您最终将更改单元格scontentViewwith yourtoViewif you use cell's contentViewas thefromView`。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-22
      相关资源
      最近更新 更多