【问题标题】:how to set animation on all child of viewflipper如何在viewflipper的所有孩子上设置动画
【发布时间】:2014-03-17 11:29:45
【问题描述】:

我有倒计时 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();

}
}

我想要所有视图的动画。

我该怎么做?

【问题讨论】:

    标签: android animation viewflipper


    【解决方案1】:

    你试过吗...?

    viewFlipper.setInAnimation();
    viewFlipper.setOutAnimation();
    

    【讨论】:

    • 是的,现在正在工作。我以为只有 viewFlipper.setAnimation();是必须的。谢谢!
    猜你喜欢
    • 2011-11-09
    • 2011-11-28
    • 1970-01-01
    • 2020-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-23
    相关资源
    最近更新 更多