2012-03-12 11 views
6

sto cercando di passare il testo di una UILabel:Perché questa CATransition non funziona?

CATransition *animation = [CATransition animation]; 
animation.duration = 4; 
animation.type = kCATransitionReveal; 
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 
[label.layer addAnimation:animation forKey:nil]; 

label.text = resultDateStr; 

Questo funziona bene. Ma quando lo imposto su kCATransitionFade, smette di funzionare. Testato su iOS 4.3 e 5.0 Qualche idea?

+3

Cosa succede? Ho appena testato questo su simulatori 4.3 e 5.1 e su dispositivi 4.2.1 e 5.1, e funziona bene con 'kCATransitionFade'. – Rob

+0

sì, funziona anche per me. –

risposta

0

Prova questa

[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]; 
0

Verificare che si esegue questa operazione sul thread principale.

Problemi correlati