动画完成后,点击图片 [英] Image click after animation
问题描述
我有这个奇怪的问题。我有我用绕一固定点的图像 rotateAnimation
。
I have this strange issue. I have an image which I rotate about a fixed point using rotateAnimation
.
当用户点击图片我已经处理click事件,如下所示:
I have handled the click event when the user clicks the images as shown below:
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.imageView1:
finish();
Intent i = new Intent(this, Next.class);
startActivity(i);
break;
}
}
我所面临的问题是,当我旋转图像,则不会触发点击事件,当我点击的形象,但是当我点击该图像是在第一次的位置被触发。
The problem I face is that, after I rotate the image, the click event is not triggered when I click the image, but is triggered when I click the position where the image was at first.
我知道我必须在这里失去了一些东西基本的,但我不明白。
I know I must be missing something basic here but I can't figure it out.
推荐答案
动画
■不要使动画查看
改变位置或大小。他们只表明这种转变不会影响任何的查看
的属性。因此,您能看到的行为。
Animation
s do not cause the animating View
to change position or size. They only show such transformations without affecting any of the properties of the View
. Hence the behavior seen by you.
在你想真正移动的情况下/调整查看
对象,实施 AnimationListener
和<执行操作code> onAnimationEnd 。
In case you want to actually move/resize the View
object, implement AnimationListener
and perform the operation on onAnimationEnd
.
这篇关于动画完成后,点击图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!