Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/193.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android形状按钮点击区域_Android_Animation_Button_Shape - Fatal编程技术网

Android形状按钮点击区域

Android形状按钮点击区域,android,animation,button,shape,Android,Animation,Button,Shape,我有下面的形状 <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:topRight

我有下面的形状

<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),但按钮的其余部分不起作用

我在没有动画的情况下尝试了它,它做的事情与你看到的按钮相同,但如果你点击它,它就不起作用

发生什么事了。更糟糕的情况是,我不介意一些内容被保留下来,但最好不要显示出来。

试试这个,让你的按钮宽度图像保持多一点

右侧的部分使其透明

它不会显示,您也可以获取点击事件

希望这能帮助你

试试这个,让你的按钮宽度图像保持多一点

右侧的部分使其透明

它不会显示,您也可以获取点击事件


希望这能帮助你

很酷,谢谢。应该工作只是想知道为什么它会发生,因为它不会显示透明区域。但它仍然在那里,所以你可以点击按钮。谢谢。应该工作只是想知道为什么它会发生,因为它不会显示透明区域。但它仍然在那里,所以你可以点击那个按钮