我正在使用以下代码来翻转我的ViewFlipper
viewFlipper.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// This is all you need to do to 3D flip
AnimationFactory.flipTransition(viewFlipper, FlipDirection.LEFT_RIGHT);
}
});如何在flipTransition完成后附加监听器?有什么建议吗?
发布于 2013-10-01 19:17:40
您可以像这样从flipperView中获取动画。
imageViewFlipper.getAnimation().setAnimationListener(new Animation.AnimationListener() {
public void onAnimationStart(Animation animation) {}
public void onAnimationRepeat(Animation animation) {}
public void onAnimationEnd(Animation animation) {
//your code after animation end
}
});为我测试和工作
发布于 2013-10-01 19:28:22
使用setAnimationListener()这将帮助您获得3个方法,即
public void onAnimationStart(Animation animation)
public void onAnimationRepeat(Animation animation)
public void onAnimationEnd(Animation animation) 相应地编写您的代码。
在onAnimationStart()中-编写动画启动时要执行的代码
onAnimationRepeat() - Write you want to be performed when the animation repeats.
onAnimationEnd(){写下动画结束时想要执行的内容
}https://stackoverflow.com/questions/19114746
复制相似问题