ScrollView无法滚动

ScrollView无法滚动

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >
    <!--头部-->
<RelativeLayout
    android:id="@+id/layout_my_header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#82cae7"
    >
    <!--点击登录-->
    <Button
        android:id="@+id/btn_login"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="@mipmap/ic_launcher"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="40dp"
        android:layout_marginBottom="20dp"
        />

    <LinearLayout
        android:id="@+id/btn_login_bottom"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:orientation="horizontal"
        android:layout_below="@+id/btn_login"
        android:layout_marginBottom="5dp"
        >
        <!--头底部第一个按钮-->
        <LinearLayout
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:gravity="center"
            >
        <ImageView
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:src="@mipmap/ic_launcher"
        />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="优惠券"
            android:textColor="#ffffff"
            />
        </LinearLayout>

        <!--头底部第二个按钮-->
        <LinearLayout
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:gravity="center"
            >
            <ImageView
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:src="@mipmap/ic_launcher"
                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="折扣券"
                android:textColor="#ffffff"
                />
        </LinearLayout>

        <!--头底部第三个按钮-->
        <LinearLayout
            android:layout_weight="1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:gravity="center"
            >
            <ImageView
                android:layout_width="24dp"
                android:layout_height="24dp"
                android:src="@mipmap/ic_launcher"
                />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="购物车"
                android:textColor="#ffffff"
                />
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>
    <!--scollview-->
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
        <!--滚动列表1-->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_below="@+id/layout_my_header"
            >
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_menu"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="我的订单"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_menu"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
            </LinearLayout>



        <!--滚动列表2-->

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_save"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="我的收藏"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_save"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
        </LinearLayout>

        <!--滚动列表3-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_pwd"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="我的口令"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_pwd"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
        </LinearLayout>

        <!--滚动列表4-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="我的锦囊"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                </RelativeLayout>

            </LinearLayout>
            <View
                android:layout_below="@+id/txt_my"
                android:layout_width="match_parent"
                android:layout_height="8dp"
                android:background="#f5f5ee"
                />

        <!--滚动列表5-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_anquan"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="安全中心"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_anquan"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
        </LinearLayout>
        <!--滚动列表6-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_dizhi"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="常用地址"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_dizhi"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
        </LinearLayout>
        <!--滚动列表7-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_fankui"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="意见反馈"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_fankui"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
            </LinearLayout>
        <!--滚动列表8-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_kefu"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="客服中心"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />

                </RelativeLayout>
                <View
                    android:layout_below="@+id/txt_my_kefu"
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="#d1d1cf"
                    android:layout_marginTop="8dp"
                    android:layout_marginRight="8dp"
                    />
        </LinearLayout>
        <!--滚动列表9-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:layout_marginTop="5dp"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:src="@mipmap/ic_launcher"
                    android:layout_marginLeft="5dp"
                    />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    >
                    <TextView
                        android:id="@+id/txt_my_seting"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="设置"
                        android:textSize="26sp"
                        android:paddingTop="18dp"
                        />
                    <View
                        android:layout_below="@+id/txt_my_seting"
                        android:layout_width="match_parent"
                        android:layout_height="1dp"
                        android:background="#d1d1cf"
                        android:layout_marginTop="8dp"
                        android:layout_marginRight="8dp"
                        />
                </RelativeLayout>
           </LinearLayout>
            
        </LinearLayout>
</ScrollView>
</LinearLayout>


正在回答

登陆购买课程后可参与讨论,去登陆

1回答

直接运行你的布局文件是可以滚动到最底部

http://img1.sycdn.imooc.com//climg/5b55359e00017a9104040666.jpg

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师