2015-07-22 60 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 
    }