This is my code, Its giving me only single ListView
, If i set height
of ListView
to wrap_content
or match_parent
. But if I define a height in terms of dp
, it starts showing me both ListView
. But it doesn't look good in that case.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="ListView1"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:layout_marginTop="45dp"
android:textColor="@color/white"
android:textStyle="bold" />
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/lv_upcoming"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:divider="@null" />
<View
android:layout_width="fill_parent"
android:layout_height="0.5dp"
android:background="#ffffff" />
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="List Number 2"
android:gravity="center_vertical"
android:textColor="@color/white"
android:fontFamily="sans-serif-condensed"
android:textSize="18sp"
android:id="@+id/tvPrevious"
android:paddingLeft="16dp"
android:paddingRight="16dp" />
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/list_view_2"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:divider="@null"/>
</LinearLayout>
</ScrollView>
Kindly guide me how to add multiple ListView
in a layout.