监听器ViewFlipper部件翻转事件监听器、部件、事件、ViewFlipper

由网友(念时光旳掌纹ヽ)分享简介:我有一个ViewFlipper实现,需要改进。这ViewFlipper有三个孩子的意见。基本上,我想一个指标上子视图是当前活动。我ViewFlipper是一个复杂的布局也有列表视图,只是一部分等。I have a ViewFlipper implementation that needs to be improved...

我有一个ViewFlipper实现,需要改进。这ViewFlipper有三个孩子的意见。基本上,我想一个指标上子视图是当前活动。我ViewFlipper是一个复杂的布局也有列表视图,只是一部分等。

I have a ViewFlipper implementation that needs to be improved. This ViewFlipper has three child views. Basically, I want an indicator on which child view is currently active. My ViewFlipper is just a part of a complex layout which also has list views, etc.

的意见交换也是自动的,在指定的时间间隔进行。

Switching of views is also automatic and done in a specified interval.

这是Android的SDK参考,我还没有看到任何监听器当ViewFlipper改变子视图。

From Android's SDK reference, I haven't seen any listener for when the ViewFlipper changes the child view.

难道你们知道的方法可以让我有一个侦听该事件?

Do you guys know of a way I can have a listener for that event?

或者是我可以实现这个功能有其他方法除了使用ViewFlipper?

Or are there alternative ways I can implement this feature besides using ViewFlipper ?

谢谢!

推荐答案

如果您应用动画(出或动画)的视图切换,您可以设置侦听器,以动画,例如,行为上的动画结束。

If you apply animation (out or in animation) on view switching, you can set listener to an animation and, for example, act on animation end.

   viewFlipper.getInAnimation().setAnimationListener(new Animation.AnimationListener() {
      public void onAnimationStart(Animation animation) {}
      public void onAnimationRepeat(Animation animation) {}
      public void onAnimationEnd(Animation animation) {}
   });
阅读全文

相关推荐

最新文章