You can't use wrap_content with a list view, because that will cause it to expand to whatever size its full contents are. If you want the list view to expand to fill all space except the text views above and below, use android:layout_height="0px" and android:layout_weight="1" on it.
On Sat, Sep 11, 2010 at 11:42 PM, Mystique <[email protected]> wrote: > Hi, I can seems to get it write. > What is wrong with my layout? > > ---code--- > <?xml version="1.0" encoding="utf-8"?> > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ > android" > android:id="@+id/main" > android:layout_width="fill_parent" > android:layout_height="fill_parent"> > <TextView > android:layout_width="fill_parent" > android:layout_height="wrap_content" > android:text="@string/test" /> > <!-- Note built-in ids for 'list' and 'empty' --> > <ListView > android:id="@android:id/list" > android:layout_width="wrap_content" > android:layout_height="wrap_content"/> > <TextView > android:id="@android:id/empty" > android:layout_width="wrap_content" > android:layout_height="wrap_content" > android:text="@string/empty" /> > </LinearLayout> > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

