我有一個ListView。在每一行中,我都有一個LinearLayout其中包含項目。 LinearLayout具有10dp的layout_margin。按下時,我已將其放置在選擇器背景上。但問題是,在10dp的邊界邊緣出現橙色背景色,而LinearLayout黑色背景內出現正確。LinearLayout按下時沒有邊框顏色
我怎麼能刪除邊緣的橙色背景出現?
選擇
<item android:state_pressed="true">
<shape>
<gradient android:angle="90" android:startColor="@color/negro" android:endColor="@color/negro" />
</shape>
</item>
<item android:state_enabled="true">
<shape>
<gradient android:angle="90" android:startColor="@color/grisOscuro" android:endColor="@color/grisOscuro" />
</shape>
</item>
XML
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="@color/black"
android:orientation="horizontal">
<LinearLayout
android:baselineAligned="false"
android:id="@+id/fondoListviewRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/grey"
android:orientation="horizontal">
...
</LinearLayout>
代碼
holderName.fondo.setBackgroundResource(R.drawable.listview_negro);
你有一個橙色的背景某處名單的背後? – 2014-09-18 16:55:57
不,這是在LinearLayout被按下時創建的橙色背景 – user4152 2014-09-18 16:57:41
,橙色只出現在邊緣的某個部分?或者完整的10dp是橙色的?這將是很好,如果你可以把截圖或東西 – 2014-09-18 17:01:56