UITableView上的动画reloadData [英] Animated reloadData on UITableView

查看:261
本文介绍了UITableView上的动画reloadData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您将如何在 UITableView 上运行 - reloadData ?数据源在 UIFetchedResultsController ,所以我不能玩 - insertSections:withRowAnimation: - deleteSections:withRowAnimation:包装在 - beginUpdates - endUpdates

How would you anime - reloadData on UITableView? Data source is on UIFetchedResultsController so I can't play with – insertSections:withRowAnimation:, – deleteSections:withRowAnimation: wrapped in – beginUpdates, – endUpdates.

编辑:
我想在之后调用 - reloadData NSFetchedResultsController refetch。

I want to call - reloadData after NSFetchedResultsController refetch.

推荐答案

我做了分类方法。

- (void)reloadData:(BOOL)animated
{
    [self reloadData];

    if (animated) {

        CATransition *animation = [CATransition animation];
        [animation setType:kCATransitionPush];
        [animation setSubtype:kCATransitionFromBottom];
        [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
        [animation setFillMode:kCAFillModeBoth];
        [animation setDuration:.3];
        [[self layer] addAnimation:animation forKey:@"UITableViewReloadDataAnimationKey"];

    }
}

这篇关于UITableView上的动画reloadData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆