Android的 - 如何以期互动已经动画片之后? [英] Android - How to interact with a view after it has been animated?
问题描述
我有一个使用 TranslateAnimation 动画视图:
I have a view that is animated using TranslateAnimation:
TranslateAnimation translateAnim = new TranslateAnimation(fromX, toX, fromY, toY);
translateAnim.setDuration(SLIDING_SPEED);
translateAnim.setInterpolator(new BounceInterpolator());
translateAnim.setFillAfter(true);
mSlidingView.startAnimation(translateAnim);
动画工作正常,但它完成后,我不能在视图中点击了。相反,我仍然可以点击它的previous位置。
The animation works fine but after it's finished I can't click on the view anymore. Instead I can still click on its previous location.
我已经寻找类似的问题(这里 ,<一个href="http://stackoverflow.com/questions/7509206/can-not-active-click-event-after-animation-of-the-view">here和<一href="http://stackoverflow.com/questions/9182893/android-unable-to-click-the-bottom-textview-after-translate-animation-within-a">here)对计算器,但他们没有提供任何解决办法。我听说了<一href="http://developer.android.com/reference/android/animation/ObjectAnimator.html#setPropertyName%28java.lang.String%29"相对=nofollow> ObjectAnimator 固定这一点,但有什么我可以用previous API吗?(我不想依赖尚未像的 NineOldAndroids 以支持在pre-蜂窝设备的新的动画API)哦,我已经尝试的无效的看法,但它不会改变任何事情。
I have searched for similar questions (here, here and here) on StackOverflow but none of them provides any solution. I have heard that the ObjectAnimator fixed this, but is there anything I can do using the previous API? (I don't want to rely on yet another third party library like NineOldAndroids to support the new animation API on pre-honeycomb devices). Oh and I have tried to invalidate the view but it doesn't change anything.
你知道吗?
谢谢!
推荐答案
嗯,我想有没有联系,但你尝试过: (setFillAfter前)
Well, I guess there is not link, but have you tried : (before setFillAfter)
translateAnim.setFillEnabled(true);
这篇关于Android的 - 如何以期互动已经动画片之后?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!