I have a ScrollView that contains a few elements, between the rest, two ListViews. The number of items in each ListView is limited, and I do not want them scrolled. I do, however, want the ScrollView itself to be scrollable, and for some reason, it is not. What is a good solution to this problem?
Almost everywhere I read, it says I should not be putting ListViews inside of a ScrollView, But I need something that looks similar to this layout, and actually functions (Including the titles, that should disappear if the corresponding list is empty and vice versa) -
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/light_gray_real">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:elevation="15dp">
<EditText
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="45dp"
android:hint="Search values here"
android:textCursorDrawable="@null"
android:paddingStart="10dp"
android:background="@android:color/transparent"/>
<ImageButton
android:id="@+id/btnClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center"
android:layout_margin="5dp"
android:src="@drawable/places_ic_clear"
android:background="@android:color/transparent"/>
</FrameLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:isScrollContainer="true">
<TextView
android:id="@+id/tvTitle1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Title 1"
android:paddingStart="10dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:visibility="gone"/>
<ListView
android:id="@+id/listview1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"/>
<TextView
android:id="@+id/tvTitle2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Title 2"
android:paddingStart="10dp"
android:paddingTop="2dp"
android:paddingBottom="2dp"
android:visibility="gone"/>
<ListView
android:id="@+id/listview2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"/>
</LinearLayout>
</ScrollView>