Android 如何检查ontouchevent中是否触摸了动画图像

Android 如何检查ontouchevent中是否触摸了动画图像,android,touch,android-animation,Android,Touch,Android Animation,在我的应用程序中,我使用了6个图像视图,从下到上为所有人提供动画,宽度和高度在线性布局中填充,现在我想添加触摸事件,但我不知道如何检查动画图像是否被触摸。 我尝试了以下代码,但这不起作用。 我应该使用什么样的方法,如何可能 public boolean onTouch(View v, MotionEvent event) { switch(v.getId()){ case R.id.imageView1: if (event.getAction() == MotionEve

在我的应用程序中,我使用了6个图像视图,从下到上为所有人提供动画,宽度和高度在线性布局中填充,现在我想添加触摸事件,但我不知道如何检查动画图像是否被触摸。 我尝试了以下代码,但这不起作用。 我应该使用什么样的方法,如何可能

 public boolean onTouch(View v, MotionEvent event) {

 switch(v.getId()){
    case R.id.imageView1:
    if (event.getAction() == MotionEvent.ACTION_UP)
        {
          //  Intent intent = new Intent(YOUR_ACTIVITY.this, NEXT_ACTIVITY.class);
            //startActivity(intent);

        iv1.startAnimation(sci);
        sci.setAnimationListener(new AnimationListener() {

            public void onAnimationStart(Animation animation) {
                // TODO Auto-generated method stub

            }

            public void onAnimationRepeat(Animation animation) {
                // TODO Auto-generated method stub

            }

            public void onAnimationEnd(Animation animation) {
                // TODO Auto-generated method stub
                   //iv3 = (ImageView)findViewById(R.id.imageView3);
                iv1.clearAnimation();
                iv1.startAnimation(hyperspaceJump);
            }
        });
        }
    break;

    case R.id.imageView2:
    case R.id.imageView3:
    case R.id.imageView4:
    case R.id.imageView5:
    case R.id.imageView6:
    }

见和@Rachel Gallen。实际上,问题是触摸事件在动画图像中起作用,但在整个图像视图中不起作用,这意味着我给出了完整的高度,所以触摸事件从上到下影响整个图像视图。我想触摸事件的工作只对动画图像。若我给出了高度包裹内容,那个么触摸事件只会影响底部,而不会影响动画图像。那么,请告诉我怎么做。。对不起,我的英语不好……谢谢……恐怕我帮不了什么忙了(