Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/199.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 将滚动视图和底部菜单放在同一视图上_Android_Xml_Android Layout_Scrollview - Fatal编程技术网

Android 将滚动视图和底部菜单放在同一视图上

Android 将滚动视图和底部菜单放在同一视图上,android,xml,android-layout,scrollview,Android,Xml,Android Layout,Scrollview,我试图将滚动视图置于屏幕底部菜单上方的布局(这只是一个包装在中的) 问题:ScrollView不起作用(它的最后一个元素无法显示在屏幕上,并且显示在菜单的“下方”,看起来根本没有ScrollView),并且我无法滚动它。 Layout.xml文件: <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

我试图将
滚动视图
置于屏幕底部菜单上方的布局(这只是一个
包装在
中的

问题:
ScrollView
不起作用(它的最后一个元素无法显示在屏幕上,并且显示在菜单的“下方”,看起来根本没有
ScrollView
),并且我无法滚动它。

Layout.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg" >
    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true">
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:paddingLeft="10dp"
            android:paddingRight="10dp" >
            <LinearLayout
                android:id="@+id/l1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:gravity="center_vertical" >
                <com.myapp.AutoResizeTextView
                    android:id="@+id/text_discounts_month"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0.6"
                    android:drawableLeft="@drawable/ic1"
                    android:drawablePadding="5dp"
                    android:gravity="center_vertical"
                    android:maxLines="100"
                    android:paddingTop="5dp"
                    android:text="@string/label1"
                    android:textColor="@color/text_black"
                    android:textSize="14sp" />
                <TextView
                    android:id="@+id/text_discounts_month_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignBaseline="@id/text_discounts_month"
                    android:layout_weight="0.4"
                    android:gravity="right"
                    android:minEms="2"
                    android:text="@string/label1_number"
                    android:textColor="@color/text_black"
                    android:textSize="14sp" />
            </LinearLayout>
            <!-- Horizontal line -->
            <View
                android:id="@+id/hr1"
                android:layout_width="fill_parent"
                android:layout_height="1dp"
                android:layout_below="@id/l1"
                android:layout_marginTop="10dp"
                android:background="@android:color/darker_gray" />
<!-- There are many more items as the item below inside the layout, i.e. LinearLayout followed by a horizontal line -->
        </LinearLayout>
    </ScrollView>
<!-- Bottom menu -->
    <LinearLayout
        android:id="@+id/down"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginTop="15dp"
        android:gravity="center_vertical" >

        <include
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            layout="@layout/menu_bottom_full" />
    </LinearLayout>
</RelativeLayout>


试试这个

<ScrollView
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/down"
        android:fillViewport="true" >

使用布局重量属性
<ScrollView
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/down"
        android:fillViewport="true" >