我的Android活动页面上有一张图片。我希望图像从底部移到顶部,然后应该消失,当前活动直接调用下一个活动。

最佳答案

尝试这个:

TranslateAnimation tAnimation = new TranslateAnimation(0, 0, 0, -250);
        tAnimation.setDuration(5000);
        tAnimation.setRepeatCount(0);
        tAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
        tAnimation.setFillAfter(true);
        tAnimation.setAnimationListener(new 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
                i.setVisibility(View.GONE);
                startNewAct();
            }
        });

        i.startAnimation(tAnimation);




public void startNewAct() {
        startActivity(new Intent(this, NextActivity.class));
    }

09-05 08:58