Android的显示键盘取消动画 [英] Android showing keyboard cancels animation

查看:1095
本文介绍了Android的显示键盘取消动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,用户可以设置动画另一个视图的视图(片段)。一个简单的ObjectAnimator执行其tranlateY伎俩和动画完成后的观点与TextViews和EditTexts可见。

In my app a user can animate a view (fragment) on another view. A simple ObjectAnimator does its tranlateY trick and after the animation is complete the view is visible with TextViews and EditTexts.

但是,当pressing一个EditText键盘表演和出于某种原因我认为,这与ObjectAnimator动画,返回到pre动画位置。首先,我认为这是因为视图获取重绘(如方向变化),所以我补充说:setRetainInstance(真);但这并不能工作。

But when pressing an EditText the keyboard shows and for some reason my view, which was animated with ObjectAnimator, returns to its pre animated position. First I thought it was because the view gets redrawn (like orientation change) so I added "setRetainInstance(true);" but that doesn't work either.

我怎样才能解决这个问题呢?

How can I fix this problem?

推荐答案

可以基本扭转动画完成的方式。代替初始化图形在它的开始位置和具有其移动到最终位置。有它在初始化的最终位置,然后从一开始到结束的动画关键帧它。我认为这将是一个更好的解决办法,因为我不认为动画实际上改变了布局,但只是蓬勃生机。

Can you essentially reverse the way the animation is done. Instead of initializing the graphic at it's starting location and having it move to a final location. Have it initialize at the the final location and then have the animation key frame it from the beginning to the end. I think this would be a better solution because I don't think that the Animation actually changes the layout but simply animates it.

希望这有助于!

这篇关于Android的显示键盘取消动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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