Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.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 ScrollView高度太短_Android_Scrollview - Fatal编程技术网

Android ScrollView高度太短

Android ScrollView高度太短,android,scrollview,Android,Scrollview,我是Android新手,在创建一个滚动视图时遇到了这个问题,这个滚动视图应该是滚动10+个项目的列表视图 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"

我是Android新手,在创建一个滚动视图时遇到了这个问题,这个滚动视图应该是滚动10+个项目的列表视图

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context="com.naqishop.naqi.MainActivity"
        tools:showIn="@layout/activity_main">


        <ScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/scrollView">

        <ListView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/listView"
            android:entries="@array/options" />


        </ScrollView>



</LinearLayout>
正如建议的那样
但它并没有改变高度。因此,感谢您的提示。

这是因为您已经设置了
android:layout\u height=“wrap\u content”
。换成
android:layout\u height=“match\u parent”
它将占据整个高度。

这是因为您设置了
android:layout\u height=“wrap\u content”
。换成
android:layout\u height=“match\u parent”
将占据整个高度。

您不能使用
android:layout\u height=“wrap\u content”
来查看
滚动视图(将其设置为
android:layou height=“match\u parent”)“
您不需要滚动视图。只需删除它。只需使用ListView。它内部包含滚动。@MichaelKatkov观点很好。谢谢!您不能使用
android:layout\u height=“wrap\u content”
来查看
滚动视图
:-(将其设置为
android:layout\u height=“match\u parent”“
您不需要ScrollView。只需将其删除。只需使用ListView。它内部包含scroll。@MichaelKatkov观点正确。谢谢!
android:fillViewport="true"