Would I recommend you put the contents of the ScrollView as a HeaderView in the ListView, or do you obviously want to have two separate scrollable areas on the screen?
An example for placing scroll content in a list as a title (one scrollable area):
public void onCreate(Bundle s){ setContentView(R.id.yourLayout); ListView listView = (ListView) findViewById(R.id.listView);
The action layout will look like this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/frameLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ListView android:id="@+id/listView" android:layout_height="match_parent" android:layout_width="match_parent" android:background="#FFF"/> </LinearLayout>
If you want two scrolling areas, you must work with the layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/frameLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ScrollView android:id="@+id/marketDetailScrollView" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > </ScrollView> <ListView android:id="@android:id/list" android:layout_height="0dp" android:layout_width="match_parent" android:background="#FFF" android:layout_weight="1"/> </LinearLayout>
source share