我正在尝试转换UILabel
的文字:
CATransition *animation = [CATransition animation];
animation.duration = 4;
animation.type = kCATransitionReveal;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
[label.layer addAnimation:animation forKey:nil];
label.text = resultDateStr;
这很好用。但是当我将它设置为kCATransitionFade
时,它就会停止工作。在iOS 4.3和5.0上测试了吗?
答案 0 :(得分:0)
试试这个
[CATransaction begin];
CATransition *animation = [CATransition animation];
animation.type = kCATransitionFade;
animation.duration = 3.50;
[self.view addSubview:mySecondUIView]
[[self.view layer] addAnimation:animation forKey:@"Fade"];
[CATransaction commit];
答案 1 :(得分:0)
验证您是否在主线程上执行此任务。