简体   繁体   English

如何在Android中执行WebView动画

[英]How to do webview animation in android

假设我有三个文本作为标题。任何如何使用textview或任何东西。一个文本在左边,一个在中心,一个在右边。所以我想要一个动画,当我向左滑动屏幕时,左边的文本会消失,中间的文字将出现在左侧,而右侧的文字将出现在中央。右幻灯片也是如此。有人可以建议我如何实现这种动画效果。PLZ帮助。

You can try to create an animation variable : 您可以尝试创建一个动画变量:

  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;
    }

then set this action to your frame: 然后将此动作设置为您的框架:

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
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM