2015-07-22 84 views
0

我正在制作一个应用程序,我们可以将视图拖到另一个视图上。下面的视图有一个触摸监听器,但当我将俯视图移到它上面时,它会被忽略。它挂了一点,但顶视图没有问题。把视图放在彼此的顶部会影响听众吗?

因此,我的问题是,听众是否会受到影响,当我们在另一个视图顶部的视图?

+1

以及对他们affected.The点击将被顶视图好评。 –

回答

0

是的,他们这样做。

检查下面的例子OnTouchListener

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY) 
    { 

    // do some thing 
     return true; // when you return true here event will not propagate to views those 
    // are in lower hierarchy. Means inside views will not be able to consume onFling event 
    }