在這裏我使用scrollview在我的linearlayout.But我想包括我的scrollview linearlayout內的另一個列表視圖。如何解決scrollview listview在linearlayout android
Scrollview支持ony一個child.I知道在scrollview列表視圖不工作。但有沒有其他選項使用listview.I想滾動所有的內容。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:id="@+id/widget54"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<LinearLayout
android:layout_width="310px"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button 1"
/>
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button 2"
/>
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button 3"
/>
<EditText
android:id="@+id/txt"
android:layout_width="fill_parent"
android:layout_height="300px"
/>
<Button
android:id="@+id/button4"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button 4"
/>
</LinearLayout>
</ScrollView>
你可以看到這一點: http://stackoverflow.com/questions/3495890/how-can-i-put-a-listview-into-a -scrollview - 沒有 - 它壓扁 – user3682351