1

我有以下形状

<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>

现在我要做的是我有一个自定义动画,将 contentleft(linearlayout) leftmargin 更改为 -200,然后当您单击按钮时,我慢慢地将左边距变为 0。所以基本上是一个滑出面板。

问题是,如果我将 contentleft 的左边距设为 -200,我无法单击按钮,如果我将其设为 -199,则 contentleft 的一部分伸出,然后按钮只能从左侧工作一点(看起来像 1px),但其余的则不行的按钮。

我在没有动画的情况下尝试了它,它和你看到的按钮一样,但是如果你点击它,它就不起作用。

这是怎么回事。更糟糕的情况我不介意一些内容左突出,但完全不显示会很好。

4

1 回答 1

1

在此处输入图像描述

试试这个让你的按钮宽度图像多一点....

右侧的某些部分使其透明。

它不会显示,您还可以获得点击事件

希望对你有帮助....!

于 2012-05-01T15:19:26.297 回答