【问题标题】:Exclude view from UIAnimation从 UIAnimation 中排除视图
【发布时间】:2014-09-23 10:37:49
【问题描述】:

我做了一个“拉动刷新”,当完成更新后,使用动画块删除了插图。但是我在自定义 uitableviewcell 中得到了不需要的动画,请看电影:

https://www.youtube.com/watch?v=rZcEBm_fTUc&feature=youtu.be

在底部仔细观察。我找到了这个: How can I exclude a piece of code inside a core animation block from being animated?

但是不知道怎么用,下面是我正在使用的代码:

    id animation = ^{
        //Remove the contentinset
        [self.tableView setContentInset:refreshView.initialInset];

    };

    [UIView animateWithDuration:0.5
                          delay:0
                        options:UIViewAnimationOptionAllowUserInteraction |UIViewAnimationOptionBeginFromCurrentState
                     animations:animation
                     completion:nil];

    [refreshView endAnimation];
}

感谢您在此问题上的任何帮助!

【问题讨论】:

    标签: uitableview core-animation pull-to-refresh


    【解决方案1】:

    我没有正确重用我的 UITableViewCells。在我从单元格中删除所有子视图并再次添加它们之前,这是错误的做法。

    通过对我的不同 UITableViewCells 使用“reuseIdentifier”,并且仅在问题消失后实例化 UILabels 和 UIButtons(以及许多其他问题)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-28
      • 2014-05-24
      • 1970-01-01
      • 2015-07-26
      • 2019-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多