2011-08-25 32 views
1

我正在使用圖庫小部件創建LinearLayouts畫廊,每個畫廊都包含一個按鈕。問題是,滾動或單擊LinearLayout時,該按鈕被「按下」狀態。我如何防止它?我希望它只對點擊按鈕有反應。LinearLayouts的Android圖庫

感謝

//編輯:連碼

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="260dip" 
    android:layout_height="wrap_content" 
    android:padding="10dip"> 

    <!-- some other things here --> 

    <Button style="@style/button" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" 
     android:text="Just testing" /> 
</LinearLayout> 
+1

你能發佈你的佈局代碼嗎?您可以嘗試將LinearLayouts設置爲android:clickable =「false」 – Codeman

+0

我已經包含代碼。 android:clickable沒有幫助,但無論如何感謝 –

+0

這可能是有意的行爲。如果它真的困擾你,你可以嘗試使用GestureListener來使GalleryView的行爲符合你的要求。 – Codeman

回答