父LinearLayout未填充到底部的ScrollView

时间:2015-03-04 17:21:23

标签: android scrollview

enter image description here

您好,

从上图中可以看出,直到滚动视图底部(蓝色),父LinearLayout才会填充。我选择将滚动视图放在底部,因为LinearLayout有一个ListView。

XML:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/finalImg"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:src="@drawable/image_01_big" />

    <RelativeLayout
        android:id="@+id/imgFinal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" >
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/linearLayoutInfoTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imgFinal"
        android:layout_centerHorizontal="true"
        android:orientation="vertical" >

        <TextView
        android:id="@+id/finalInfoTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="infoTitle"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textStyle="bold" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutInfo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imgFinal"
        android:layout_marginTop="20dp"
        android:orientation="horizontal" >

        <TextView
        android:id="@+id/finalInfoDesc"
        android:layout_width="match_parent"
        android:layout_height="84dp"
        android:gravity="center"
        android:text="infoDesc"
        android:textAppearance="?android:attr/textAppearanceMedium" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayoutInfo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imgFinal"
        android:layout_marginTop="20dp"
        android:orientation="horizontal" >

        <TextView
        android:id="@+id/finalLineUpStatic"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="Line Up"
        android:textStyle="bold"
        android:textAppearance="?android:attr/textAppearanceMedium" />
    </LinearLayout>

    <ListView
        android:id="@+id/finalListView"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:layout_above="@+id/Scroll"
        android:layout_below="@+id/linearLayoutInfo"
        android:layout_centerHorizontal="true"
        android:layout_weight=".94"
        android:fadeScrollbars="false" >

    </ListView>





    <ScrollView 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:fillViewport="true"
        >


        <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >


        <LinearLayout
            android:id="@+id/Lin_Scroll"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >

            <RelativeLayout
            android:id="@+id/Rel_Scroll"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <RelativeLayout
                android:id="@+id/Rel_add_gps"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:layout_marginBottom="65dp" >

                <RelativeLayout
                android:id="@+id/RelGPS"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_toRightOf="@+id/RelAddress" >

                <TextView
                    android:id="@+id/finalGPSStatic"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:gravity="center"
                    android:text="GPS"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/finalGPS"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignLeft="@+id/finalGPSStatic"
                    android:layout_below="@+id/finalGPSStatic"
                    android:gravity="center"
                    android:text="click"
                    android:textAppearance="?android:attr/textAppearanceMedium" />
                </RelativeLayout>

                <RelativeLayout
                android:id="@+id/RelAddress"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true" >

                <TextView
                    android:id="@+id/finalAddressStatic"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:gravity="center"
                    android:text="Address"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/finalAddress"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignLeft="@+id/finalAddressStatic"
                    android:layout_below="@+id/finalAddressStatic"
                    android:gravity="center"
                    android:text="not static"
                    android:textAppearance="?android:attr/textAppearanceMedium" />
                </RelativeLayout>
            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/Rel_ven_dat"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_above="@+id/Rel_add_gps"
                android:layout_alignParentLeft="true"
                android:layout_marginBottom="22dp"
                android:background="@color/gray"
                 >

                <RelativeLayout
                android:id="@+id/RelDate"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_toRightOf="@+id/RelVenue" 

                android:background="@color/blue"
                >

                <TextView
                    android:id="@+id/finalDateStatic"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:gravity="center"
                    android:text="Date"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/finalDate"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignLeft="@+id/finalDateStatic"
                    android:layout_below="@+id/finalDateStatic"
                    android:gravity="center"
                    android:text="not static"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:id="@+id/finalTime"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignLeft="@+id/finalDateStatic"
                    android:layout_below="@+id/finalDate"
                    android:gravity="center"
                    android:text="not static"
                    android:textAppearance="?android:attr/textAppearanceMedium" />
                </RelativeLayout>

                <RelativeLayout
                android:id="@+id/RelVenue"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true" >

                <TextView
                    android:id="@+id/finalVenueStatic"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:gravity="center"
                    android:text="not static"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/finalVenue"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignLeft="@+id/finalVenueStatic"
                    android:layout_below="@+id/finalVenueStatic"
                    android:gravity="center"
                    android:text="not static"
                    android:textAppearance="?android:attr/textAppearanceMedium" />
                </RelativeLayout>
            </RelativeLayout>
            </RelativeLayout>
        </LinearLayout>

        <ProgressBar
            android:id="@+id/progressBar2"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <RelativeLayout
            android:id="@+id/RelButtonTop"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2.45" >

            <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="42dp"
            android:text="Button" />

            <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_marginRight="54dp"
            android:text="Button" />

            <RelativeLayout
            android:id="@+id/RelativeLayout01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_weight="2.45" >

            <Button
                android:id="@+id/Button01"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:layout_marginLeft="42dp"
                android:text="Button" />

            <Button
                android:id="@+id/Button02"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_alignParentTop="true"
                android:layout_marginRight="54dp"
                android:text="Button" />
            </RelativeLayout>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/RelativeLayout02"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="2.45" >

            <Button
            android:id="@+id/Button03"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="42dp"
            android:text="Button" />

            <Button
            android:id="@+id/Button04"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_marginRight="54dp"
            android:text="Button" />
        </RelativeLayout>

        <Button
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="Button 11" />
        </LinearLayout>

    </ScrollView>
</LinearLayout>

0 个答案:

没有答案