각 행 레이아웃에 각 상태에 대해 다른 배경을 지정하는 선택기로 구성된 배경을 지정해야합니다.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="2dip"
android:background="@drawable/transparent_selector"> ...
및 transparent_selector이 정의된다 : 조심스럽게 하나 당김 형태는 하나의 상태에 속하는 시계를 당신의 품목 행 레이아웃은 XML에 정의 된 RelativeLayout의가 있다고 가정하자.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@drawable/shape_7"/>
<item android:state_pressed="true" android:drawable="@drawable/shape_7" />
<item android:state_pressed="false" android:drawable="@drawable/transparent_shape" />
</selector>
과 모양이 정의된다 :
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF4FDBD5"
android:endColor="#FF1AA6A1"
android:type="linear"
android:angle="90"/>
</shape>
또는 당신이 'convertView'
환호에 선택기를 할당 할 수있는 ListView 항목을 구성 다른 방법으로
** 기본 ** 선택기를 사용하고 싶습니다. 내가 주문을 만들고 싶지 않기 때문에 그럴 수 없습니까? – Curtain
글쎄 스타일을 전혀 지정하지 않으면 시스템에서 기본 선택기를 설정하지만이 선택기는 시장 응용 프로그램에있는 선택기와 다릅니다. – Franco
기본 선택기를 가져 오지 않았습니다. – Curtain