继承自ListActivity,
xml中配置如下:
<ListView
android:id="@id/android:list"
android:layout_below="@id/queryResult"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false"
android:layout_marginTop="10px"
android:paddingLeft="5px"
android:paddingRight="5px"
android:cacheColorHint="#00000000" //滚动时背景不变为黑色
android:stackFromBottom="true" //滚动到最后一条
android:transcriptMode="alwaysScroll" //滚动到最后一条
/>
代码中:
getListView().setScrollbarFadingEnabled(true);//活动时显示滚动条不活动时隐藏滚动条。