【问题标题】:Cannot animate view with CATiledLayer correctly无法正确使用 CATiledLayer 为视图设置动画
【发布时间】:2010-11-17 21:16:19
【问题描述】:

带有 CATiledLayer 的 UIView 可以有动画吗?

如果我调用以下代码:

[myContentView setNeedsDisplay];

CGContextRef 上下文 = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:10]; [UIView 提交动画];

如果 UIView 是没有 CATiledLayer 的“普通”UIView,这将很有效。但是,一旦我添加了 CATiledLayer 类型的子图层,动画就无法正常工作。 翻页有效,但在动画完成之前不会显示底层页面(只是空白)。

我试过 [myContentView setNeedsDisplay];在动画块之前,之后甚至中间。如果 myContentView 有 CATiledLayer,则没有区别。

任何帮助表示赞赏。

【问题讨论】:

    标签: iphone uiview ipad catiledlayer


    【解决方案1】:

    想通了:

    缓存:是];

    设置为否

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多