思路:
1.viewPager有setOnPageChangeListener可以监听切换动作,但viewFlipper却死活没类似的东西。!
此处有一个变种思路,基于animation,animation结束时是有事件的,哈哈,搞定。!
viewFlipper.getInAnimation().setAnimationListener( new Animation.AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub //此处显示对应的点即可 } });
效果:
【安卓】给ViewFlipper加指示器,类似ViewPagerIndicator库提供的那种、!,布布扣,bubuko.com