【问题标题】:How to get positon in TranslateAnimation?如何在 TranslateAnimation 中获得位置?
【发布时间】:2020-09-26 12:26:15
【问题描述】:

如何使用平移动画获取移动视图的位置。

TranslateAnimation animation = new TranslateAnimation(0.0f, 300.0f,
                    0.0f, 0.0f);
            animation.setDuration(500);
            animation.setFillAfter(true);
            mainview.startAnimation(animation);

【问题讨论】:

    标签: java android android-layout user-interface animation


    【解决方案1】:

    您需要在 startAnimation 命令之前设置一个新的 AnimationListener。您可以使用 AnimationListener 的 Override 方法,请调试它以获得更好的理解。在开始动画之前,您需要 setAnimationListener。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-18
      • 1970-01-01
      • 1970-01-01
      • 2011-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多