如何控制移动视图在另一个视图? [英] How to control moving View over another View?

查看:107
本文介绍了如何控制移动视图在另一个视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法将红的LinearLayout 对另一的LinearLayout usign TranslateAnimation

I managed to move red LinearLayout over another LinearLayout usign TranslateAnimation.

我确实是控制动画的开始,但不喜欢 YouTube的应用或者我必须等待,直到动画完成其他类似的应用程序。

I indeed control start of animation, but not like in YouTube app or other similar apps as I have to wait until the animation finishes.

如何才能获得更多的控制权,红色的运动的LinearLayout

How can I gain more control over the movement of red LinearLayout?

推荐答案

您必须设置动画听众对你的动画,像这样

You have to set an animation listener over your animation, like this

       animationRed.setAnimationListener(new AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onAnimationRepeat(Animation animation) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                // TODO Auto-generated method stub


            }
        });

这篇关于如何控制移动视图在另一个视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆