【问题标题】:Android animation moves layout from right to leftAndroid 动画从右向左移动布局
【发布时间】:2012-01-30 10:19:21
【问题描述】:

我使用动画将布局从右向左移动。

动画无法正常工作。当视图移动时,移动视图的底部和右侧边缘会绘制在屏幕上,如下图所示。 有谁知道原因以及如何解决这个问题?谢谢!

【问题讨论】:

  • 分享你的代码,否则如果不看代码就很难说出你的问题。
  • 你说的图片在哪里?显示您的代码。

标签: android animation layout right-to-left


【解决方案1】:

参考链接here。该动画适用于列表视图适配器和活动。你试试吧。

私有动画 inFromRightAnimation() {

    Animation inFromRight = new TranslateAnimation(
            Animation.RELATIVE_TO_PARENT, +1.0f,
            Animation.RELATIVE_TO_PARENT, 0.0f,
            Animation.RELATIVE_TO_PARENT, 0.0f,
            Animation.RELATIVE_TO_PARENT, 0.0f);
    inFromRight.setDuration(500);
    inFromRight.setInterpolator(new AccelerateInterpolator());
    return inFromRight;
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-25
    • 2015-09-05
    • 1970-01-01
    • 2011-07-06
    • 1970-01-01
    • 1970-01-01
    • 2016-03-21
    相关资源
    最近更新 更多