具有alpha效果的渐变按钮android

时间:2013-02-14 04:08:48

标签: android gradient android-button android-selector

我正在尝试使用渐变+ alpha效果在android中创建一个按钮,但不能完全按照我想要的方式进行操作。

以下是我想要获得的按钮图像: -

enter image description here

我使用下面的选择器作为我的按钮样式&效果: -

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true"><shape>
            <gradient android:angle="180" android:centerColor="#657377" android:endColor="#AFFFFFFF" android:startColor="#FFFFFFFF" android:type="linear"/>

            <corners android:radius="10dp" />
        </shape></item>

</selector>

如果有人有任何想法,请帮助我。感谢

0 个答案:

没有答案
相关问题