I have LinearLayout whcih contains Buttons and ListViews. After getting many buttons and I decide to put that LinearLayout into ScrollView but after putting ScrollView my ListViews are showing only one Item.
Following is the code before ScrollView
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".WorkplaceObservationActivity" >
<Button
android:id="@+id/btn_reportType"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Report Type" />
<ListView
android:id="@+id/lv_reportType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" >
</ListView>
<Button
android:id="@+id/btn_defineJob"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Define Job" />
<ListView
android:id="@+id/lv_Jobs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:visibility="gone" >
</ListView>
<Button
android:id="@+id/btn_timeLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Time and Location" />
<LinearLayout
android:id="@+id/ll_timeLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<Button
android:id="@+id/btn_setCurrentTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Use current time and date" />
<Button
android:id="@+id/btn_setCustomTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Enter custom time" />
<Button
android:id="@+id/btn_setCustomDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Enter custom date" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Time and Date: "
android:textAppearance="?android:attr/textAppearanceMedium"
android:visibility="gone" />
</LinearLayout>
<Button
android:id="@+id/btn_ReportDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Report Details" />
<LinearLayout
android:id="@+id/ll_ReportDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<Button
android:id="@+id/btn_CaptureVideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Capture Video" />
<ListView
android:id="@+id/lv_ReportDetailsItems"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
</ListView>
</LinearLayout>
<Button
android:id="@+id/btn_Review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Review" />
<LinearLayout
android:id="@+id/ll_Review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_Review_ReportType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Report Type: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv_Review_DateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date and Time: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv_Review_SupportingFiles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Supporting Files: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<ListView
android:id="@+id/lv_ReviewItems"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" >
</ListView>
<Button
android:id="@+id/btn_Review_Send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Send" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="@+id/btn_Review_Save"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Save Draft" />
<Button
android:id="@+id/btn_Review_Discard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Discard" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
for Above Code I am getting Following Screen Shot
Following is the xml code after ScrollView
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".WorkplaceObservationActivity" >
<Button
android:id="@+id/btn_reportType"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Report Type" />
<ListView
android:id="@+id/lv_reportType"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" >
</ListView>
<Button
android:id="@+id/btn_defineJob"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Define Job" />
<ListView
android:id="@+id/lv_Jobs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:visibility="gone" >
</ListView>
<Button
android:id="@+id/btn_timeLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Time and Location" />
<LinearLayout
android:id="@+id/ll_timeLocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<Button
android:id="@+id/btn_setCurrentTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Use current time and date" />
<Button
android:id="@+id/btn_setCustomTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Enter custom time" />
<Button
android:id="@+id/btn_setCustomDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="Enter custom date" />
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Time and Date: "
android:textAppearance="?android:attr/textAppearanceMedium"
android:visibility="gone" />
</LinearLayout>
<Button
android:id="@+id/btn_ReportDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Report Details" />
<LinearLayout
android:id="@+id/ll_ReportDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone" >
<Button
android:id="@+id/btn_CaptureVideo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Capture Video" />
<ListView
android:id="@+id/lv_ReportDetailsItems"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" >
</ListView>
</LinearLayout>
<Button
android:id="@+id/btn_Review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Review" />
<LinearLayout
android:id="@+id/ll_Review"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tv_Review_ReportType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Report Type: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv_Review_DateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date and Time: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv_Review_SupportingFiles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Supporting Files: "
android:textAppearance="?android:attr/textAppearanceMedium" />
<ListView
android:id="@+id/lv_ReviewItems"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" >
</ListView>
<Button
android:id="@+id/btn_Review_Send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Send" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2" >
<Button
android:id="@+id/btn_Review_Save"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Save Draft" />
<Button
android:id="@+id/btn_Review_Discard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Discard" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
and following is the sceen shot of above
I want to show complete list of items after scrollview.