我有 5 秒倒计时的取景器。
我应用了淡入淡出动画,但这种效果是第一次出现。
即当 5 变为 4 时。从那时起没有动画生效。
public class TatSplash extends Activity implements OnClickListener{
ViewFlipper timer;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.tatsplash);
timer = (ViewFlipper) findViewById(R.id.timer);
timer.setOnClickListener(this);
timer.setFlipInterval(1000);
timer.startFlipping();
AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f);
animation.setDuration(1000);
timer.setAnimation(animation);
}
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
timer.showNext();
}
}
我想要所有 View 的动画。
我该怎么做?
最佳答案
你试过吗?
viewFlipper.setInAnimation();
viewFlipper.setOutAnimation();
关于android - 如何在 viewflipper 的所有 child 上设置动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22453168/