Android list view inside a scroll view
I have an android layout setup where I have a scrollview with a whole
bunch of elements in it, and then at the bottom of the scroll view i have
a listview which is filled with an adapter.
The problem that I am having is that android is excluding the listview
from the scrolview as a scrollview has a scrolable function. I want the
listview to just be as long as it is. and for the master scroll view to be
scrolable.
how can i achieve this?
Here is my code in the main layout:
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:fillViewport="true"
android:gravity="top" >
<LinearLayout
android:id="@+id/foodItemActvity_linearLayout_fragments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
I then programmatically add my components to the linearlayour with the id:
foodItemActvity_linearLayout_fragments. Below is one of the views that is
loaded into that linearlayout. this is the one giving me trouble with the
scrolls.
<?xml version="1.0" encoding="utf-8"?>
<TextView
android:id="@+id/fragment_dds_review_textView_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Reviews:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ListView
android:id="@+id/fragment_dds_review_listView"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</ListView>
My adapter then fills up this list view.
Here is an image from the android hierarchy viewer when I click on the
master scrollview:
As you can see, it is excluding the reviews listview???
I should be able to scroll the page down and see 8 reviews, but instead it
only shows me those 3, and i can scroll on the tiny part where the reviews
are. I want a global page scroll
No comments:
Post a Comment