Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.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_Scrollview - Fatal编程技术网

Android 滚动视图不工作

Android 滚动视图不工作,android,scrollview,Android,Scrollview,我有一个滚动视图,可以动态地填充代码。我希望如果我把太多的内容放在parant视图中,该视图会变成可滚动的。这是行不通的 <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill

我有一个滚动视图,可以动态地填充代码。我希望如果我把太多的内容放在parant视图中,该视图会变成可滚动的。这是行不通的

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true">

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_centerHorizontal="true"
            android:id="@+id/layoutScoreBoardHeader"
            android:layout_marginTop="15dp">

        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/layoutScoreBoard"
            android:orientation="horizontal"
            android:layout_centerHorizontal="true"
            android:layout_below="@id/layoutScoreBoardHeader">

        </LinearLayout>

    </RelativeLayout>
</ScrollView>


布局结构不正确。RelativeLayout应包装内容。在您的情况下,它将与初始ScrollView的大小相同,并且将忽略子大小。

我有它。不知道有一个特殊的视图像水平滚动视图。但谢谢你们的反馈

显示您添加了什么以及如何添加