我有一个 UIButton 的 Selected 状态和一个 Normal 状态,它们都是 UIImages。当一个按钮被触摸时,我希望它达到选定状态,然后在一秒钟内动画回到正常状态。当按下 UIButton* btn 时,我设置了以下动画,但它只是再次切换回取消选择状态。我应该如何实现这一目标?
[btn setSelected:YES];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0f];
[btn setSelected:NO];
[UIView commitAnimations];
干杯
尼克