Je souhaite changer la couleur d'arrière-plan UIButton du noir au blanc. Mais je veux le changer dans l'animation. Par exemple ... noir> gris> blanc. Y at-il un moyen simple de le faire dans iPhone SDK? Je vous remercie.Comment animer la couleur d'arrière-plan UIButton
1
A
Répondre
7
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 300, 50)];
[button setTitle:@"hi" forState:UIControlStateNormal];
[button setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:button];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.5];
button.backgroundColor = [UIColor whiteColor];
[UIView commitAnimations];
0
Propriété backgroundColor est animable depuis la version 3.2 SDK.
Questions connexes
- 1. Animer des images UIButton
- 2. Comment animer un UIButton dans un UITableView?
- 3. Comment puis-je animer une propriété UIButton Alpha avec MonoTouch?
- 4. Animer mouvement et à l'échelle de l'image UIButton
- 5. set gradient couleur (couleur) pour uibutton background image iphone sdk
- 6. Animer les transitions de changement de couleur
- 7. Comment animer des vues?
- 8. Modifier la couleur UIBarButtonItem
- 9. Comment animer (déplacer) un UIButton, en le gardant touchable pendant le mouvement?
- 10. Comment animer la couleur de remplissage du chemin tracé avec CGContextDrawPath, etc dans drawRect :?
- 11. Animer plusieurs UIButtons
- 12. Définition de la couleur d'ombre pour le titre de UIButton dans la plume
- 13. uibutton + setselected
- 14. Comment animer une fenêtre?
- 15. Comment animer explicitement la backgroundColor d'une CALayer?
- 16. Comment animer la propriété textColor d'un UILabel?
- 17. Comment animer View.setVisibility (GONE)
- 18. Comment animer des nuages?
- 19. Comment animer dans Cocos2d?
- 20. Question concernant UIButton
- 21. Animer un changement de largeur dans un UIButton avec un point central fixe
- 22. Jquery, anime la couleur de fond?
- 23. Est-il possible de réussir à animer un UIButton en mouvement?
- 24. iPhone - Comment animer un bouton lorsqu'il est pressé?
- 25. UIButton redimensionner avec animation
- 26. Android: Animer Regarder la position
- 27. animer contenu textarea
- 28. ensemble ButtonType de UIButton programme
- 29. multiline uibutton
- 30. UIButton dans UITableViewCell