Ho riscontrato uno strano problema con i blocchi di animazione di iPhone. Questo codice:UIView animateWithDuration: ritardo: funzionamento strano
[UIView animateWithDuration:2 delay: 0 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor blueColor]]; }
completion: nil];
[UIView animateWithDuration:2 delay: 2 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor redColor]]; }
completion: nil];
imposta istantaneamente lo sfondo rosso, senza passare lo stato blu. La stessa cosa anche per questo codice:
[UIView animateWithDuration:2 delay: 0 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor blueColor]]; }
completion:
^(BOOL wrwg) {
[UIView animateWithDuration:2 delay: 2 options: 0 animations:
^(void) { [controller setBackgroundColor: [UIColor redColor]]; }
completion: nil];
}];
cioè, dove provo a fare funzionare la seconda animazione dopo il primo è terminato. Qual è il problema?
Che tipo di oggetto è il controller? Un UIView, UILabel, altro? – Anna