Hi, that is the whole point of a scroll view -- its children are put in a
virtual scrollable container that doesn't impact the size of the scroll view
itself.

You should never put a list view inside of a scroll view.

On Fri, Aug 14, 2009 at 2:47 PM, Sena <[email protected]> wrote:

>
> Hi,
>
> I have a ListView which is embedded in a ScrollView. I populate the
> rest of the Views in the ScrollView, then populate the ListView.
> Unfortunately yhe ScrollView doesn't size itself to accomodate the
> items in the ListView. Am I missing something? Is there a way to get
> the View to resize itself to accomodate the contents of the ListView?
>
> Thanks
> S
>
> Here is the View in question :
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
>        xmlns:admob="http://schemas.android.com/apk/res/
> com.imkon.android.jiradroid"
>        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>        android:orientation="vertical">
>
>        <com.admob.android.ads.AdView android:id="@+id/ad"
>                android:layout_width="fill_parent"
> android:layout_height="wrap_content"
>                admob:backgroundColor="#000000" admob:textColor="#FFFFFF"
>                admob:keywords="Android application"
> admob:refreshInterval="60"/>
>
>        <ScrollView xmlns:android="http://schemas.android.com/apk/res/
> android"
>                android:layout_width="fill_parent"
> android:layout_height="wrap_content" android:paddingLeft="1mm">
>
>                <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                        android:orientation="vertical">
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iProject"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> project_label" />
>
>                                <TextView android:id="@+id/iProjectT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iKey"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> key_label" />
>
>                                <TextView android:id="@+id/iKeyT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iPriority"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> priority_label" />
>
>                                <TextView android:id="@+id/iPriorityT"
>                                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                        android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iStatus"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> status_label" />
>
>                                <TextView android:id="@+id/iStatusT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iResolution"
>                                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>
>  android:text="@string/resolution_label" />
>
>                                <TextView android:id="@+id/iResolutionT"
>                                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                        android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iCreated"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> created_label" />
>
>                                <TextView android:id="@+id/iCreatedT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iUpdated"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> updated_label" />
>
>                                <TextView android:id="@+id/iUpdatedT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iDuedate"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> duedate_label" />
>
>                                <TextView android:id="@+id/iDuedateT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iVotes"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:text="@string/
> votes_label" />
>
>                                <TextView android:id="@+id/iVotesT"
> android:layout_width="wrap_content"
>                                        android:layout_height="wrap_content"
> android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iEnvironment"
>                                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>
>  android:text="@string/environment_label" />
>
>                                <TextView android:id="@+id/iEnvironmentT"
>                                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                        android:textSize="20.0sp" />
>
>                        </LinearLayout>
>
>                        <LinearLayout xmlns:android="
> http://schemas.android.com/apk/res/
> android"
>                                android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>                                android:orientation="vertical">
>
>                                <TextView android:id="@+id/iComments"
>                                        android:layout_width="wrap_content"
> android:layout_height="wrap_content"
>
>  android:text="@string/comments_label" />
>
>                                <ListView
>                                        android:id="@android:id/list"
>                                        android:layout_width="fill_parent"
>                                        android:layout_height="fill_parent"
>                                        android:scrollbars="none"
>                                />
>
>                        </LinearLayout>
>
>                </LinearLayout>
>
>        </ScrollView>
>
> </LinearLayout>
>
> ---
>
> Here is the element view used to render the items in the list :
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout
> android:id="@+id/pListLayout"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> android:orientation="vertical"
> xmlns:android="http://schemas.android.com/apk/res/android";
> >
>
>
>        <TextView
>        android:id="@+id/cCreated"
>        android:layout_width="wrap_content"
>        android:layout_height="wrap_content"
>        />
>
>        <TextView
>        android:id="@+id/cAuthor"
>        android:layout_width="wrap_content"
>        android:layout_height="wrap_content"
>        />
>
>        <TextView
>        android:id="@+id/cBody"
>        android:layout_width="wrap_content"
>        android:layout_height="wrap_content"
>        android:textSize="20.0sp"
>        />
>
> </LinearLayout>
>
> >
>


-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to