如何在android中进行webview动画

时间:2011-09-30 07:22:07

标签: android animation

假设我有三个文本作为标题。任何你可以采取textview或任何东西。一个文本在左边,一个在中心,一个在右边。所以我想要一个动画,当我将滑动屏幕左,然后左文本将消失了,中心文本将左右文本将到达中心。正确的幻灯片。任何人都建议我如何实现这种类型的动画.Plz帮助。

1 个答案:

答案 0 :(得分:0)

您可以尝试创建动画变量:

  private Animation leftAnimation() {

        Animation outtoLeft = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, 0.0f,
                Animation.RELATIVE_TO_SELF, 0.0f,
                Animation.RELATIVE_TO_SELF, 1.0f,
                Animation.RELATIVE_TO_SELF, 0.0f);
        outtoLeft.setDuration(500);
        outtoLeft.setInterpolator(new AccelerateInterpolator());
        return outtoLeft;
    }

然后 将此操作设置为您的框架:

public void onLeftArrowClick(View v) {
        frame.setAnimation(moveComingSoonToBottomAnim); // your Frame variable
        animVariable.startNow();// your anime variable
        frame.setVisibility(View.VISIBLE);
        rightFrame.setVisibility(View.GONE); // hide your right text view
    }