Restart CoreAnimation after view appears

I have a custom view with additional layers and a simple endless animation (using core animation). The view is a subclass of UITableViewCell and therefore doesn't have it's own view controller.

The animation gets stopped whenever the view disappears, which is fine. But how do I restart the animation when the view reappears?


I found one way of doing it. This might not be the best solution, but at least it's very simple. Just add this in the corresponding UITableViewController :

-(void)viewWillAppear:(BOOL)animated{
    [self.tableView reloadData];
}
链接地址: http://www.djcxy.com/p/74190.html

上一篇: 在使用CABasicAnimation时,CALayer不会绘制其内容

下一篇: 出现视图后重新启动CoreAnimation