0
目的:只描繪頂部和底部。創建一個不完整的按鈕描邊
我已經試過:
下面是我的XML的副本。 我試過在This Stack Overflow Answer的解決方案。 但我的問題是,不讓我選擇按照解決方案切斷左右1Dp的選項。
任何想法?
代碼:
<?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:startColor="@color/secondaryButtonStartColorSelected"
android:endColor="@color/secondaryButtonEndColorSelected"
android:angle="270" />
<stroke
android:width="@dimen/secondary_button_border_size"
android:color="@color/secondaryButtonBorderColorSelected" />
</shape>
</item>
<item android:state_focused="true" >
<shape>
<gradient
android:startColor="@color/secondaryButtonStartColorSelected"
android:endColor="@color/secondaryButtonEndColorSelected"
android:angle="270" />
<stroke
android:width="@dimen/secondary_button_border_size"
android:color="@color/secondaryButtonBorderColorSelected"/>
</shape>
</item>
</selector>