UILabel's backgroundColor não é animador?
Tenho um gridView, uso para exibir váriosGridViewCell : UIView
. OGidViewCell
adiciona um UILabel a si próprio e anexa umUITapGestureRecognizer
para si mesmo
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)];
[self addGestureRecognizer:gestureRecognizer];
[gestureRecognizer release];
emtapped:
Quero reproduzir algumas animações, incluindo alterar a cor de fundo do rótulo
- (void) tapped:(id)sender {
[UIView animateWithDuration:1.0
delay:0
options:(UIViewAnimationOptionAllowUserInteraction)
animations:^{
[(UILabel *)[[self subviews] objectAtIndex:0] setBackgroundColor:[UIColor blueColor]];
}
completion:^(BOOL finished){
[(UILabel *)[[self subviews] objectAtIndex:0] setBackgroundColor:[UIColor whiteColor]];
}
];
[self.delegate didSelectGridViewCell:self];
}
Mas a etiqueta apenas pisca em azul para um piscar de olhos - se é que existe. Se eu usar o mesmo código, mas ajustar o alfa do rótulo em vez da cor do plano de fundo, tudo funcionará conforme o esperad
Documentos da Apple lista backgroundColor como animador.É isso? Estou fazendo algo errado