tags:

views:

58

answers:

1

Before I added my ListView, along with changing my TableLayout height to "wrap_content" as opposed to "fill_parent", my ScrollView displayed properly. Here is my XML: <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>

I get no ScrollView when I have "wrap_content" and my display is askew! Any ideas?

A: 

I actually did some experimenting with different values in the height. When I provide a specific height, the total display is how it should be. I simply added a specific value to my TableLayout height and my ScrollView height and all is well.

I am not sure why this is so, but it works. If anyone wishes to explain the logic...feel free! :)

taraloca