我有一些代码,很好地工作,并像单击按钮时出现的菜单一样。我只是想略微动画。所以,当它出现时,它出现在反弹。下面是这表明它弹跳图像进入查看
[UIView beginAnimations:@"theAnimation" context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(yourAnimationHasFinished:finished:context:)];
[UIView setAnimationDuration: 0.3];
CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0, -20);
scrollChangeClothing.transform = moveUp;
imgClothesMenuBg.transform = moveUp;
[UIView commitAnimations];
[UIView beginAnimations:@"theAnimation" context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(yourAnimationHasFinished:finished:context:)];
[UIView setAnimationDuration: 0.1];
CGAffineTransform moveUp = CGAffineTransformMakeTranslation(0, 0);
scrollChangeClothing.transform = moveUp;
imgClothesMenuBg.transform = moveUp;
[UIView commitAnimations];
上面的代码(我认为)应该首先显示的图像在-20像素的起点,然后沉降回到它的原点的代码。
我试过将转换命令组合起来,但那也没用。我是否需要在setAnimationDidStopSelector中放置第二个动画?所以一旦完成,它会反弹?