2012-05-01 151 views
1

我有以下形狀Android的形狀按鈕,點擊區域

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
<gradient android:angle="360" android:endColor="@color/LightBlue" android:startColor="@color/DarkBlue"/> 
    <corners android:topRightRadius="10dp" android:bottomLeftRadius="10dp"/> 
</shape> 

,這個按鈕

<Button android:id="@+id/butLeft" android:layout_width="25dp" 
      android:layout_height="@dimen/contentTabHeight" android:background="@drawable/lefttabbackground" 
      android:layout_toRightOf="@id/contentLeft" 
      android:layout_centerVertical="true"></Button> 

現在我要做的就是我有LEFTMARGIN來改變contentleft(LinearLayout中)的自定義動畫 - 200,然後當你點擊按鈕時,我慢慢地將左邊距變爲0.所以基本上是一個滑出面板。

問題是,如果我讓leftlegin的contentleft -200我不能點擊按鈕,如果我做到了-199 contentleft的一部分伸出,然後按鈕只工作從左邊一點(看起來像1px)但不是按鈕的其餘部分。

我嘗試了它沒有動畫,它做同樣的事情,你看到的按鈕,但如果你點擊它不起作用。

發生了什麼事情。更糟糕的情況下,我不介意一些contentleft伸出,但它會很好,根本不顯示。

回答

1

enter image description here

嘗試更該讓你的按鈕寬度圖像有點....

有些部分從右側使它透明。

它不會顯示,你還可以得到敲打事件

希望這將幫助你......!

+0

很感謝。如果工作只是想知道爲什麼它發生 – Pintac

+0

由於透明區域,它不會顯示。但它仍然在那裏,所以你正在點擊那個按鈕 – MAC