开发Android项目的时候经常会用到ExpandableListView,它是ListView的子类,因此使用起来和ListView差不多,和其匹配的Adapter有BaseExpandableListAdapter,SimpleExpandableListAdapter和SimpleCursorTreeAdapter,这里,我只说明一下继承BaseExpandableListAdapter的用法,这种方法很灵活,而且难度不大。
在xml中,只要写上如下代码即可
<ExpandableListView
android:id="@+id/help_exp_listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:groupIndicator="@null"
>
</ExpandableListView>
1.android:childDivider,指定各组内各子列表项之间的分割条
2.android:childIndicator,显示在子列表项旁边的Drawable对象