按钮不响应翻译动画完成后,点击事件 [英] Button not responding to Click Event after Translation animation

查看:113
本文介绍了按钮不响应翻译动画完成后,点击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经进行了翻译动画按钮,一切工作,因为我除外,但只有问题是动画完成后,该按钮不响应点击事件,请大家指正。

 按钮B =(按钮)findViewById(R.id.button1);
    TranslateAnimation滑动=新TranslateAnimation(0,30,0,-40);
    slide.setDuration(500);
    slide.setZAdjustment(TranslateAnimation.ZORDER_TOP);
    slide.setFillAfter(真正的);

    b.startAnimation(幻灯片);
 

解决方案

如果你正在处理的动画在(低于蜂窝)低级别的API动画居然不移动按钮,但只有它的images.Its单击将在同一个地方在这里,你已经把它放在你的布局。

I have performed a Translation animation on button ,everything work as i excepted ,but only the problem is after the animation the button not responding to click event please correct me

Button b=(Button)findViewById(R.id.button1);
    TranslateAnimation slide=new TranslateAnimation(0, 30, 0,-40);
    slide.setDuration(500);
    slide.setZAdjustment(TranslateAnimation.ZORDER_TOP);
    slide.setFillAfter(true);

    b.startAnimation(slide);

解决方案

If you are handling animations at lower level API (below HoneyComb) your animation actually does not moves the button but only its images.Its click will be at same place where you have placed it in your layout.

这篇关于按钮不响应翻译动画完成后,点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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