0

I am trying to add 3 or more lists in a layout xml. I didn't expect this to be a problem, but I don't see all the lists(and they get populated) and the view does not scroll. I need an opinion to what stupid stuff I am doing here, please.

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/googleDrawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white" >

    <RelativeLayout
        android:id="@+id/navigationHeader"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:background="@drawable/wallpaper"
        android:paddingTop="16dp" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_margin="@dimen/activity_horizontal_margin"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/searchTxt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Search" />

            <TextView
                android:id="@+id/txtUsername"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/holo_green_light"
                android:text="Hello, user"
                android:textColor="@android:color/white"
                android:textSize="14sp"
                android:textStyle="bold" />

            <TextView
                android:id="@+id/txtDescription"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/holo_blue_light"
                android:text="description"
                android:textColor="@android:color/white" />
        </LinearLayout>
    </RelativeLayout>

    <ScrollView
        android:id="@+id/scrollojt"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/navigationHeader"
        android:fillViewport="true" >

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="@dimen/activity_horizontal_margin" >

            <View
                android:id="@+id/separator"
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginBottom="8dp"
                android:background="#1f000000" />

            <TextView
                android:id="@+id/questionsTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/separator"
                android:text="@string/questions_label"
                android:textAllCaps="true"
                android:textColor="@android:color/black" />

            <ListView
                android:id="@+id/drawerList"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/questionsTitle"
                android:background="@android:color/holo_green_dark"
                android:clickable="true"
                android:focusableInTouchMode="true"
                android:scrollbars="vertical" />

            <TextView
                android:id="@+id/appsTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/drawerList"
                android:text="@string/apps_label"
                android:textAllCaps="true"
                android:textColor="@android:color/black" />

            <ListView
                android:id="@+id/drawerList2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/appsTitle"
                android:background="@android:color/holo_red_dark"
                android:clickable="true"
                android:focusableInTouchMode="true"
                android:scrollbars="vertical" />

            <TextView
                android:id="@+id/groupsTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/drawerList2"
                android:text="@string/groupapps_label"
                android:textAllCaps="true"
                android:textColor="@android:color/black" />

            <ListView
                android:id="@+id/drawerList3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/groupsTitle"
                android:background="@android:color/holo_blue_bright"
                android:clickable="true"
                android:focusableInTouchMode="true"
                android:scrollbars="vertical" />

            <TextView
                android:id="@+id/dmTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/drawerList3"
                android:text="@string/directapps_label"
                android:textAllCaps="true"
                android:textColor="@android:color/black" />

            <ListView
                android:id="@+id/drawerList4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/dmTitle"
                android:background="@android:color/holo_green_light"
                android:clickable="true"
                android:focusableInTouchMode="true"
                android:scrollbars="vertical" />
        </RelativeLayout>
    </ScrollView>

</RelativeLayout>
Gabi Radu
  • 1,107
  • 2
  • 16
  • 35

1 Answers1

0

Use just one ListView with an ArrayAdapter.

how to use arrayadapter

If you need help customizing the array adapter, just search on google or ask me ;)

Community
  • 1
  • 1
MiguelHincapieC
  • 5,445
  • 7
  • 41
  • 72