2012-05-01 142 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