android – EditText卡住了动画后,活着回滚滚动…?

android – EditText卡住了动画后,活着回滚滚动…?,第1张

概述我面对一个非常有趣但令人厌烦的错误,在我的线性布局中,我已经隐藏了另一个线性布局,使用边距为负数,当用户从列表中选择一个类型时,我将布局布局在前面使用“转换动画”,错误是布局到了有一个编辑文本死了,当我滚动(我的主要布局被滚动视图包围)它活着,当我停止滚动它再次死亡我真的没有判断为什么发生这样的家伙帮助. … 我也粘贴了下面的视频链接,显示我的应用程序的这个烦人的行为 http://www.dai 我面对一个非常有趣但令人厌烦的错误,在我的线性布局中,我已经隐藏了另一个线性布局,使用边距为负数,当用户从列表中选择一个类型时,我将布局布局在前面使用“转换动画”,错误是布局到了有一个编辑文本死了,当我滚动(我的主要布局被滚动视图包围)它活着,当我停止滚动它再次死亡我真的没有判断为什么发生这样的家伙帮助. …

我也粘贴了下面的视频链接,显示我的应用程序的这个烦人的行为

http://www.dailymotion.com/video/xlskk8_android-app-edit-text-error_tech

我的布局xml里面的滚动视图是

<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:layout_wIDth="fill_parent"androID:layout_height="wrap_content"androID:orIEntation="vertical"> <linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:layout_wIDth="fill_parent"androID:layout_height="wrap_content"androID:layout_marginleft="10dip"androID:layout_marginRight="10dip"androID:layout_margintop="-110dip"androID:layout_marginBottom="5dip"androID:ID="@+ID/notes_editor"androID:orIEntation="vertical"><EditText androID:ID="@+ID/enter_note" androID:layout_height="wrap_content" androID:layout_wIDth="fill_parent" androID:maxlines="2" androID:lines="2"></EditText><buttonandroID:ID="@+ID/save_note" androID:layout_height="wrap_content" androID:layout_wIDth="wrap_content"androID:text="Save" /></linearLayout><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:layout_wIDth="fill_parent"androID:layout_height="wrap_content"androID:layout_margintop="-10dip"androID:ID="@+ID/notes_List"androID:orIEntation="vertical"></linearLayout></linearLayout>

按钮下方的空线性布局用于动态添加子视图,其他所有功能正确执行其功能,只有显示此异常行为的编辑文本.

用于动画的代码如下

public voID animateEditor(){      slIDer = new TranslateAnimation(0,180 );           slIDer.setDuration(1250);           slIDer.setFillAfter(true);        notes_List.startAnimation(slIDer);        notes_editor.startAnimation(slIDer);}
解决方法 你们为什么投票拒绝我的问题?这是有效的问题,经过长时间的搜索,我也找到了答案,这里的问题是当应用slIDer.setFillAfter(true);代码动画化视图的图像,但不是实际的视图,这就是为什么当我看到他们滑动动画后,他们(编辑文本和保存按钮)卡住了,或者你可以说死亡,不听他们的事件,因为实际的意见是在布局在前面只是他们的形象

我发现这个问题的解决方案是应用以下代码

slIDer.setFillAfter(false);slIDer.setFillBefore(false);// OR you can directly writeslIDer.setFillEnabled(false);

然后通过设置动画监听器并使用以下方法显示新位置的实际视图

public voID onAnimationEnd(动画a)

通过使用上述方法将视图放置在动画结束时的新位置.而这里还有另一个闪烁的问题,这是由于AndroID动画侦听器方法中的问题,即在实际动画结束之前被调用,并导致闪烁效果,其棘手的解决方案是将第一行中的以下代码行的public voID onAnimationEnd(Animation a)方法

// in my case animation applIEd to notes_editor so the code will be    notes_editor.clearanimation();

所以,如果你不能帮助或不能得到某人的话,那么他们就不要粗鲁

谢谢

总结

以上是内存溢出为你收集整理的android – EditText卡住了动画后,活着回滚滚动…?全部内容,希望文章能够帮你解决android – EditText卡住了动画后,活着回滚滚动…?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1132352.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存