我该如何在安卓中创建像下面这样的按钮?对于按钮的主要部分,我基本上已经做好了。但是我似乎无法弄清楚阴影和点击动画。
按钮
<Button
android:text="Connect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/connectionStatus"
android:layout_centerHorizontal="true"
android:id="@+id/button"
android:background="@drawable/button_background"
android:minWidth="300dp"
android:layout_marginTop="32dp"
android:onClick="onClick"
android:textColor="#fff"
/>
这里是可绘制对象。
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#21D4FD"
android:endColor="#B721FF"
android:angle="45"
/>
<corners android:bottomLeftRadius="20dip"
android:topRightRadius="20dip"
android:topLeftRadius="20dip"
android:bottomRightRadius="20dip"
/>
</shape>
这是我目前拥有的内容: 这是我想要的内容: