Maybe I'm not understanding what the question is; you be the judge.
With this layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
>
        <ProgressBar android:id="@+id/progress"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
        />
        <TextView android:id="@+id/search_header"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="@string/default_search_header"
        />
        <TextView android:id="@+id/page_info"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
        />
    <ListView android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:transcriptMode="normal"
    />

    <ImageView android:id="@id/android:empty"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#000000"
        android:src="@drawable/beer"
        android:scaleType="centerCrop"
    />

</LinearLayout>

I produce this layout on Android:
http://picasaweb.google.com/lh/photo/3fBAdPCyjWVMOHhixCENkg?authkey=Gv1sRgCPukwpvPkpasrgE&feat=directlink



On Mar 11, 4:21 pm, Bob Kerns <r...@acm.org> wrote:
> Are you sure? This sounds like exactly what I was asking earlier
> today, based on my experience with Spinner. I speculated that ListView
> might exhibit the same behavior.
>
> You describe the behavior I was expecting. Instead, the Spinner
> ignored all constraints. If I put it first in the layout, it would
> overlay or squeeze out the text. (I forget what distinguished the two
> behaviors).
>
> If I put it second, the text would fail to wrap and the Spinner would
> get squeezed out. I just could not get the Adapter-supplied views to
> participate in the sizing process.
>
> I expect that I could have given it a fixed size, but that would be a
> bug itself.
>
> I don't have time to try it again with ListViews at the moment, but if
> anyone can confirm this working, especially with RelativeLayout, I'd
> appreciate it.
>
> On Mar 11, 10:35 am, Brion Emde <brione2...@gmail.com> wrote:
>
>
>
> > You can totally do this.
>
> > Make sure that your TextView is set to
> > android:layout_height="wrap_content" and not to "fill_parent". That
> > will surely do what you are describing.
>
> > ---
>
> > On Mar 11, 5:35 am, Pipen <erik.ing...@gmail.com> wrote:
>
> > > Dear All,
>
> > > I've tried to add a TextView before a ListView in a LinearLayout. The
> > > result is that the ListView wont show at all. The same thing happens
> > > if I put the TextView after the ListView, but then I will only see the
> > > ListView.
>
> > > Is there a way to get a text view above the ListView without to much
> > > of a hassle?
>
> > > Kind regards

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to