0

I currently have 5 list views on 1 page each displaying database elements filtered on days of the week, mon, tue, wed etc... which looks fine when there is only 1 element in each list but when I add multiple elements to a list it sets up a scroll instead of just extending the list. I'm currently already using a scroll view so the scroll of the list doesn't work. How can I change the list view to remove the scroll?

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/background"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:padding="5dip"
android:orientation="horizontal"
android:paddingTop="5dip"
android:paddingBottom="5dip"
>
    <LinearLayout
    android:orientation="vertical"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent">
    <TextView
        android:id="@+id/view_timetable_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/view_timetable_text"
        android:textColor="@color/text"
        android:textSize="30dip"
        android:layout_gravity="center"
        android:textStyle="italic"
        />
    <TextView
        android:id="@+id/text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textColor="@color/text"
        />  
        <TextView
        android:id="@+id/day"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Monday"
        android:textColor="@color/text"
        />
        <ListView
        android:id="@+id/mylist"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
            android:layout_weight="1">
            </ListView>
        <TextView
        android:id="@+id/day"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Tuesday"
        android:textColor="@color/text"
        />
    <ListView
        android:id="@+id/mylist2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>
    <TextView
        android:id="@+id/day"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Wednesday"
        android:textColor="@color/text"
        />
    <ListView
        android:id="@+id/mylist3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>
    <TextView
        android:id="@+id/day"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Thursday"
        android:textColor="@color/text"
        />
    <ListView
        android:id="@+id/mylist4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>
    <TextView
        android:id="@+id/day"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Friday"
        android:textColor="@color/text"
        />
    <ListView
        android:id="@+id/mylist5"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>
    </LinearLayout>
    </ScrollView>

1 Answers1

0

You need to use TableLayout or LinearLayout for Every ListView that you have used in your xml.Check this SO for not use ListView inside ScrollView.Click here

Community
  • 1
  • 1
Herry
  • 7,037
  • 7
  • 50
  • 80
  • The problem with that is in my java file that relates to the xml I use adapter.getFilter().filter("Monday"); to filter the days. Is there any way of doing a filter on a linearlayout? – user1341620 Apr 24 '12 at 13:22