按钮不响应翻译动画完成后,点击事件按钮、事件、动画、完成后

2023-09-12 10:19:38 作者:情真亦是真﹌

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

 按钮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单击将在同一个地方在这里,你已经把它放在你的布局。

PS做动画点击播放按钮不动

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.

 
精彩推荐
图片推荐