Android ScrollView嵌入在RelativeLayout中的TableLayout中,ListView外部不工作
在添加ListView之前,将我的TableLayout高度更改为“wrap\u content”而不是“fill\u parent”,我的ScrollView显示正确。以下是我的XML:Android ScrollView嵌入在RelativeLayout中的TableLayout中,ListView外部不工作,android,listview,scrollview,tablelayout,Android,Listview,Scrollview,Tablelayout,在添加ListView之前,将我的TableLayout高度更改为“wrap\u content”而不是“fill\u parent”,我的ScrollView显示正确。以下是我的XML: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TableLayout android:id="@+id/details"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:stretchColumns="1">
<TableRow>
<TextView android:text="Restaurant Name: " />
<EditText android:id="@+id/name" />
</TableRow>
<TableRow>
<TextView android:text="Address: " />
<EditText android:id="@+id/addr" />
</TableRow>
<TableRow>
<TextView android:text="Type:" />
<ScrollView
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<RadioGroup android:id="@+id/types"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<RadioButton android:id="@+id/fastfood"
android:text="Fast-Food" />
<RadioButton android:id="@+id/family"
android:text="Family" />
<RadioButton android:id="@+id/casual_dining"
android:text="Casual Dining" />
<RadioButton android:id="@+id/fine_dining"
android:text="Fine Dining" />
<RadioButton android:id="@+id/cafe"
android:text="Cafe" />
<RadioButton android:id="@+id/cafeteria"
android:text="Cafeteria" />
<RadioButton android:id="@+id/coffeehouse"
android:text="Coffeehouse" />
<RadioButton android:id="@+id/pub"
android:text="Pub" />
<RadioButton android:id="@+id/greasy_spoon"
android:text="Greasy Spoon" />
<RadioButton android:id="@+id/chain"
android:text="Chain" />
<RadioButton android:id="@+id/truck_stop"
android:text="Truck Stop" />
<RadioButton android:id="@+id/smorgasbord"
android:text="Smorgasbord" />
</RadioGroup>
</ScrollView>
</TableRow>
<TableRow>
<TextView android:text="" />
<Button android:id="@+id/save"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Save" />
</TableRow>
</TableLayout>
<ListView android:id="@+id/restaurants"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@id/details" />
</RelativeLayout>
当我有“wrap_内容”并且我的显示倾斜时,我没有滚动视图!有什么想法吗?我实际上用不同的高度值做了一些实验。当我提供一个特定的高度时,总的显示应该是这样的。我只是给我的TableLayout高度和ScrollView高度添加了一个特定值,一切都很好 我不知道为什么会这样,但它是有效的。如果有人想解释逻辑……请随意!:)