【问题标题】:android: Transition animationandroid:过渡动画
【发布时间】:2014-07-02 11:50:34
【问题描述】:

我有一个单一的问卷布局。有没有可能当我点击next时,会出现过渡效果?没有特别改变任何东西,只是播放动画效果作为用户进入下一个问题的错觉。

【问题讨论】:

  • 请更具体地说明您要查找的动画类型(alpha、翻译等)。另外,请发布与您希望制作动画的组件相关的代码和布局。
  • 我正在寻找一种过渡效果,就像您在布局之间更改时的效果一样,我希望在单击按钮时发生过渡,但在相同的布局中,不做任何更改.. 我想要知道它是否可能以及我应该搜索什么。
  • 可以有很多“过渡效果”。你可以做一个滑动过渡,一个淡入淡出过渡,等等,如果你不向任何人展示你的代码/布局是什么样的,就很难提供帮助。
  • 这样的滑动动画。我无法上传任何代码..我需要整个布局来滑动动画,我应该搜索什么?

标签: android animation layout transition


【解决方案1】:
// this animation will move the animation outside to the left.
TranslateAnimation exitAnimation = new TranslateAnimation(0, -exitingView.getWidth(), 0, 0);
exitAnimation.setDurtion(someDurationInMilliseconds);
exitAnimation.setAnimationListener(new TranslateAnimation.AnimationListener() {

    public void onAnimationEnd(Animation animation) 
    {
        exitingView.setVisibility(View.GONE);
    }
public void onAnimationRepeat(Animation animation) { }

public void onAnimationStart(Animation animation) { }

});

exitingView.startAnimation(exitAnimation);

enteringView.setVisibility(View.VISIBLE);
// ... create an animation for the entering view similar to above.

这应该让你开始。

【讨论】:

    猜你喜欢
    • 2013-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-20
    • 2015-05-28
    • 1970-01-01
    相关资源
    最近更新 更多