Thursday, June 30, 2011

Listview cheats


Do you have a dymanically changing listView  then always use the tag("fill_parent")instead of  ("wrap_content") for its height for the list view.Android will redraw the listview whenever it find wrap content  on adapter.notifydatasetchange and if the list   is not  load use textview with the parameter below to fill the listview space


android:id="@android:id/empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"(ie only work when used with list with below parameter is used
android:id="@android:id/list"
android:layout_below="@id/header"
android:layout_width="fill_parent"
android:layout_height="fill_parent")

No comments:

Post a Comment