如何使問題textview位於列表頂部,就好像它是列表的第一項一樣,讓問題隨着需要向下拉伸,然後開始列表在它下面,而他們都可以通過相同的滾動條滾動?列表頂部的Textview,可滾動的容器
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroller"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_above="@+id/linearLayout2"
android:layout_alignParentTop="true"
android:layout_weight="4.34"
android:fillViewport="true"
android:scrollbars="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/question_content"
android:layout_width="match_parent"
android:layout_height="56dp"
android:padding="8dip"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="84dp"
android:layout_weight="0.10" >
</ListView>
</LinearLayout>
</ScrollView>
? – madprops
是的,在這種情況下,問題將只是一個額外的列表項,它將滾動以及其他項目。 –