我正在使用ViewFlipper来显示一系列图像,但我尝试应用的动画(缩放+淡入淡出)仅显示在ViewFlipper的最后一个图像上。谁知道我哪里出错了?以下是我的代码:
mViewFlipper = (ViewFlipper) fragmentView.findViewById(R.id.view_flipper);
mViewFlipper.setVisibility(View.VISIBLE);
for(int i=0;i<galleryGridImages.size();i++)
{
setFlipperImage(galleryGridImages.get(i));
}
AnimationSet as = new AnimationSet(false);
fade = new AlphaAnimation(1.0f,0.0f);
fade.setDuration(transitionSpeed);
as.addAnimation(fade);
zoom = new ScaleAnimation(1, 3, 1, 3, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
zoom.setDuration(transitionSpeed);
as.addAnimation(zoom);
mViewFlipper.setOutAnimation(as);
mViewFlipper.setAutoStart(true);
mViewFlipper.setFlipInterval(interval);
mViewFlipper.startFlipping();