本文实例讲述了Android开发实现ListView点击展开收起效果。分享给大家供大家参考,具体如下:
废话不说先上效果:
实际上这是采用一个ExpandableListView实现的
布局文件很简单:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="请选择您的类型:"
android:textSize="30sp"
android:textColor="#ffffffff"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="#ff000000"/>
android:id="@+id/list"
android:layout_width="match_parent"
android:l