我最近使用以下代码创建了类似的...
list_rowGroup.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".ExpandView"
>
<ExpandableListView
android:id="@+id/listView"
android:layout_width="252dp"
android:layout_height="422dp"
android:groupIndicator="@drawable/group_indicator"
android:textColor="#DB0F31"
android:background="#A9ABA6"
android:smoothScrollbar="true"
>
</ExpandableListView>
lisrrowDetails.xml
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:clickable="true"
android:orientation="vertical"
android:paddingLeft="40dp"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:text="@string/hello_world"
android:textSize="14sp"
android:textStyle="bold"
android:drawableLeft="@drawable/apple" />
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="@dimen/check"
android:layout_weight="0.86"
android:text="@string/check" />
活动扩展视图
CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="?android:attr/listPreferredItemHeight"
android:layout_marginLeft="8dp"
android:gravity="left"
android:paddingLeft="32dp"
android:paddingTop="8dp"
android:textSize="14sp"
android:textAlignment="textEnd"
android:textStyle="bold"
android:textColor="#FA0557"
android:background="#C7BDC0"
/>
Group_indicator.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:drawable="@drawable/down_ic"
android:state_empty="true"/>
<item
android:drawable="@drawable/up_ic"
android:state_empty="false"/>
</selector>