ListView이 있습니다. 각 행에는 LinearLayout 안에 항목이 있습니다. LinearLayout에는 layout_margin이 10dp입니다. 내가 그것을 누르면 셀렉터 배경을 배치했습니다. 그러나 문제는 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);
당신이 목록 뒤에 어딘가 오렌지 배경이 있습니까 나에게 준다? –
아니요, LinearLayout을 – user4152
으로 누르면 주황색 배경이 만들어지고 주황색 부분이 여백의 일부에 나타 납니까? 또는 완전한 10dp가 주황색입니까? 스크린 샷이나 무언가를 넣을 수 있다면 좋을 것입니다. –